Connecting to an Instance
Connect via SSH with an SSH Key (Recommended)
Linux/MacOS
- On Ubuntu or Mac, use the following command to generate an RSA SSH public/private key pair:
`ssh-keygen -t rsa`
- Force the agent to load the new private key and verify that it’s loaded:
ssh-add; ssh-add -l
- Retrieve the content of your SSH public key:
cat ~/.ssh/id_rsa.pub
- Paste the content into the “SSH Public Keys” section in the Console - Settings (opens in a new tab).
Windows
Generating SSH keys on Windows requires additional command-line tools like Cmder, with operations similar to those on Linux.
Since most machine learning and AI programming is performed on Linux, we strongly recommend installing a Linux subsystem on your Windows machine, such as WSL.
Common Issues
If you encounter a “Permission denied (publickey)” error, it might be due to:
- Attempting to run SSH/SCP from within an instance;
- Incorrect key setup or using the wrong/unmatched key;
- The SSH key format used is incorrect or unsupported;
- The private key wasn’t correctly loaded with
ssh-add
; you may need to use the-i
parameter; - New or updated keys not taking effect for already created resources;
- Incorrect SSH key permission settings.
Use the ssh -vv
command for detailed information.
Connect via SSH with a Password
Go to Console - Instances (opens in a new tab), select the instance you want to connect to, click “Connect”, and copy the “Basic SSH Terminal” command to your terminal. Log in using the password provided in the pop-up window.