SSH connection
Once you run a workspace, you can fully leverage the development environment using SSH.
Running workspace
SSH instructions

1. Create SSH Key (only once)

First, a ssh key pair is needed. The public key will be added to your account and workspace instance so that you can connect with the private key. This can be skipped if you already have a key.
1
$ ssh-keygen -t ed25519 -C "savvihub-floyd"
2
Generating public/private ed25519 key pair.
3
Enter file in which to save the key (/Users/floyd/.ssh/id_ed25519):
4
Enter passphrase (empty for no passphrase):
5
Enter same passphrase again:
6
Your identification has been saved in /Users/floyd/.ssh/id_ed25519.
7
Your public key has been saved in /Users/floyd/.ssh/id_ed25519.pub.
8
The key fingerprint is:
9
SHA256:78yjMGcJoV73v/jkLHIRhdC0wL0FBL6c68T0MZGoV2Q savvihub-floyd
10
The key's randomart image is:
11
+--[ED25519 256]--+
12
| .+BEo |
13
| ..=+oo |
14
| . o =+ |
15
| . + +o. |
16
| . + S o. |
17
| . . * *.o |
18
| . o B +.. |
19
| B.++* |
20
| o+=+*. |
21
+----[SHA256]-----+
Copied!

2. Add SSH public key to your SavviHub account

With SavviHub CLI, the SSH public key should be added to your account. The added keys will be injected to every running workspace you created. You can manage the keys with savvihub ssh-keys list and savvihub ssh-keys delete.
1
$ savvihub ssh-keys add
2
[?] SSH public key path: /Users/floyd/.ssh/id_ed25519.pub
3
[?] SSH public key name: savvihub-floyd
4
5
Successfully added.
Copied!

3. Connect via CLI

If there are more than one running workspaces, you will be asked to select one to connect.
1
$ savvihub workspace ssh
2
The authenticity of host '[tcp.apne2-prod1-cluster.savvihub.com]:30787 ([52.78.240.117]:30787)' can't be established.
3
ECDSA key fingerprint is SHA256:iSexO7W1U14P3Pp6wRfPleHABQQMek/JAgb5kHqg5Jw.
4
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
5
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.14.238-182.422.amzn2.x86_64 x86_64)
6
7
* Documentation: https://help.ubuntu.com
8
* Management: https://landscape.canonical.com
9
* Support: https://ubuntu.com/advantage
10
This system has been minimized by removing packages and content that are
11
not required on a system that users do not log into.
12
13
To restore this content, you can run the 'unminimize' command.
14
15
The programs included with the Ubuntu system are free software;
16
the exact distribution terms for each program are described in the
17
individual files in /usr/share/doc/*/copyright.
18
19
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
20
applicable law.
21
Copied!

4. Setup VSCode Remote-SSH plugin config

You also can easily add your workspace to VSCode Remote-SSH plugin config. savvihub workspace vscode adds the information to ~/.ssh/config so that the workspace can show up in the host list.
1
$ savvihub workspace vscode
2
Successfully updated /Users/floyd/.ssh/config
3
4
$ cat ~/.ssh/config
5
Host acceptable-bite-1627438220
6
User vessl
7
Hostname tcp.apne2-prod1-cluster.savvihub.com
8
Port 30787
9
StrictHostKeyChecking accept-new
10
CheckHostIP no
11
IdentityFile /Users/floyd/.ssh/id_ed25519
Copied!
VSCode Remote-SSH plugin
Select configured SavviHub workspace
Successfully connected

5. Manual access

If you want to make SSH connection without SavviHub CLI or integrate with another IDE, use the host, username, and port written on the dialog. In this case, host is tcp.apne2-prod1-cluster.savvihub.com, username is vessl, and port is 30787. The full SSH command is ssh -p 30787 -i ~/.ssh/id_ed25519 [email protected].
Last modified 4mo ago