SSH¶
SSH (Secure Shell) is a network protocol that enables secure remote login and command execution over insecure networks.
Using SSH, users can securely access container instances on the platform from their local machines.
Log in to a Container Instance Using SSH Username/Password¶
-
In the container’s terminal, install the
openssh-server
service.If it's already installed, you may skip this step and proceed to Step 2.
-
Run the following command to install the SSH server:
-
Verify the installation:
-
Check for SSH processes:
-
Check installed packages:
-
-
-
After the container starts, click the SSH Login button in the container instance list to open a dialog with login information.
-
Use the provided username and password in your local terminal to log in. If successful, you'll see a confirmation message:
Passwordless SSH Login¶
After importing your SSH public key in User Center → SSH Keys, newly created or restarted instances will support passwordless login.
Step 1: Check for Existing SSH Public Key¶
Before generating a new SSH key, check if you already have one. SSH key pairs are usually stored in the local user’s home directory.
For Linux/macOS, use the commands below.
Windows users can use WSL (Windows 10+) or Git Bash.
-
ED25519 key:
-
RSA key:
If a long string starting with ssh-ed25519
or ssh-rsa
is returned, a key already exists.
You may skip Step 2 and proceed to Step 3.
Step 2: Generate SSH Key¶
If Step 1 returns nothing, generate a new SSH key:
-
Open your terminal (on Windows, use WSL or Git Bash) and run
ssh-keygen
. -
Choose the algorithm and optional comment (usually your email address):
-
For ED25519:
-
For RSA:
-
-
Press Enter to accept the default save path:
Example (ED25519):
- Private key:
/home/user/.ssh/id_ed25519
- Public key:
/home/user/.ssh/id_ed25519.pub
- Private key:
-
Optionally set a passphrase:
You can leave it empty to avoid entering a password every time.
-
Press Enter to complete the key pair generation.
Step 3: Copy Public Key¶
You can either copy the key manually from the terminal or use one of the following commands depending on your OS:
Step 4: Add SSH Key on the Platform¶
-
Log in to the d.run UI, and go to User Center → SSH Keys.
-
Paste your SSH public key into the input field.
<!--
→
- Key Title: A name to help you identify the key.
- Expiration Time: Set a key expiration date. The key becomes invalid after that time. Leave blank for permanent validity.