This article has been archived. Please see Coder Docs for the updated version.
This article will show you how to access your Coder Enterprise environments via SSH.
Before using, configuring, and accessing your environment via SSH:
- Your administrator must not have disabled access
- You must have the Coder CLI installed on your local machine before proceeding.
You can access your environments via SSH by configuring your local machine as follows:
$ coder config-ssh
On success, you'll see a message like:
An auto-generated ssh config was written to "/Users/yourName/.ssh/config"
Your private ssh key was written to "/Users/yourName/.ssh/coder_enterprise"
You should now be able to ssh into your environment
Your environment is now accessible via
ssh coder.<environment_name> (e.g.,
ssh coder.myEnv if your environment is named
Accessing Coder Enterprise via VS Code
Once you've set up SSH access to Coder Enterprise, you can work on projects locally using VS Code, then connect to a predefined environment for compute, etc.
- Open VS Code locally.
- Make sure that you've installed Remote - SSH.
- In VS Code's left-hand nav bar, click Remote Explorer.
- Make sure you're viewing SSH Targets and click + to add a new host. In the prompt that appears, select your alias for Coder Enterprise (e.g.,
VS Code will open a new window connected to your remote container, allowing you to add your folder(s) and continue working.
You will need to rerun the
coder config-ssh command again if:
- You reconfigure or modify their keypair using the Coder dashboard
- You add additional environments (running this command will ensure that your ~/.ssh/config file populates properly)
Coder Enterprise supports the use of the SFTP protocol. To connect to an environment using SFTP, run:
$ sftp coder.<environment_name>