We use cookies to make your experience better.
Before accessing your workspace via SSH:
To access your servers via SSH, run the following using the Coder CLI:
coder config-ssh
You should see the following returned:
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 workspace
For example, try running
$ ssh coder.backend
Your workspace is now accessible via ssh coder.<workspace_name>
(e.g.,
ssh coder.myEnv
if your workspace is named myEnv
).
To start an SSH port forwarding session:
ssh -L [localport]:localhost:[remoteport] coder.[workspace]
Parameter | Description |
---|---|
localport | The port to use on your local machine (e.g., localhost:3000 ) |
remoteport | The port of the server you want to access in the workspace |
You can use either HTTP or HTTPS, though the latter may result in certificate-related errors.
At this point, you can access the server in the browser using the localport
value.
You will need to rerun the coder config-ssh
command if:
Coder supports the use of the SFTP protocol. To connect to a workspace using
SFTP, run sftp coder.<workspace_name>
.
You can use rsync
to transfer files to and from Coder.
To do so, use the flag -e "coder ssh"
in your rsync
transfer invocation. For
example, the following shows how you can transfer your home directory to your
workspace:
rsync -e "coder ssh" -a --progress ~/project [email protected]<workspace-name>:~/project
See an opportunity to improve our docs? Make an edit.