I use Codeanywhere. The cloud IDE is okay but I'd rather use Visual Studio Code. Since I'm on a work computer without admin rights, I have a portable version of Visual Studio Code that I'd like to use to connect to my CodeAnywhere container. I found a couple of extensions that let you mount a folder through ssh. They are SSH FS and FS Remote. But I can't figure out how to actually connect. Anyone have any experience with this? Or know any alternatives to hosting a container remotely and connect with VSC code? Thanks
Asked
Active
Viewed 1,425 times
3
-
From time to time I use the [SSH FS](https://marketplace.visualstudio.com/items?itemName=Kelvin.vscode-sshfs) extension, but only to access and modify some files on a few servers. I'm not sure if you're able to use it to connect to your container since this extension just mounts a remote folder over SSH as a local workspace folder. – Joey Mar 12 '19 at 02:23
1 Answers
3
The following are instructions from a Mac.
Setting up SSH keys
- Open a terminal.
- Run the command to generate the SSH keys: ssh-keygen -t rsa
- Hit enter to accept the default location to save the key.
- Hit enter twice when prompted for entering passphrase.
- Copy the public key: pbcopy < ~/.ssh/id_rsa.pub
- Open an SSH session on your Codeanywhere container.
- Paste your copied public key to the file ~/.ssh/authorized_keys on the container.
Gather Container Information
- Right-click the container and select Info.
- You'll get an information page specifically for your container such as host and port.
Setting up Visual Studio Code
- Install Remote - SSH extension by Microsoft for Visual Studio Code.
- Click on the button at the left bottom corner of VSC, which will open the command palette with a list of Remote-SSH options.
- Select Open Configuration File...
- Select the ssh config file to edit, example /Users/username/.ssh/config
- Add the following, but fill in the info for your container:
Host Codeanywhere
HostName hostXX.codeanyhost.com
User cabox
Port 12345
IdentityFile ~/.ssh/id_rsa
- Save and exit the config file.
- Again, open the command palette for Remote-SSH and select Connect to Host.

user3284497
- 31
- 4