Skip to content

Will it be possible to create an SSH tunnel to a Codespaces instance? #25497

Answered by Chuxel
paveloom asked this question in Codespaces
Discussion options

You must be logged in to vote

UPDATE: You can now set up a connection using the GitHub CLI. See https://docs.github.com/en/codespaces/developing-in-codespaces/using-github-codespaces-with-github-cli#ssh-into-a-codespace and gh codespace ssh --help for setup options (like --server-port to specify a localhost port for use with other ssh clients).


See if this works for you:

  1. Create a codespace
  2. Connect to it using VS Code locally
  3. Next, open a terminal (Crtl+Shift+`) in VS Code and run the following:
    curl -sSL https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/sshd-debian.sh | sudo bash -s -- 2222 $(whoami) true random
    
  4. Take note of the password that was generated and the SSH command.
  5. P…

Replies: 11 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@shotgunner
Comment options

@Chuxel
Comment options

@cross-hello
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@Chuxel
Comment options

@gtxg16
Comment options

@gtxg16
Comment options

@Chuxel
Comment options

Comment options

You must be logged in to vote
1 reply
@shotgunner
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment