Skip to content

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

  1. 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:

      apt-get update && apt install openssh-server
      
    • Verify the installation:

      • Check for SSH processes:

        ps -e | grep ssh
        
      • Check installed packages:

        dpkg -l | grep ssh
        
  2. After the container starts, click the SSH Login button in the container instance list to open a dialog with login information.

  3. 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 CenterSSH 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:

    cat ~/.ssh/id_ed25519.pub
    
  • RSA key:

    cat ~/.ssh/id_rsa.pub
    

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:

  1. Open your terminal (on Windows, use WSL or Git Bash) and run ssh-keygen.

  2. Choose the algorithm and optional comment (usually your email address):

    • For ED25519:

      ssh-keygen -t ed25519 -C "<your-comment>"
      
    • For RSA:

      ssh-keygen -t rsa -C "<your-comment>"
      
  3. Press Enter to accept the default save path:

    Example (ED25519):

    Enter file in which to save the key (/home/user/.ssh/id_ed25519):
    
    • Private key: /home/user/.ssh/id_ed25519
    • Public key: /home/user/.ssh/id_ed25519.pub
  4. Optionally set a passphrase:

    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    

    You can leave it empty to avoid entering a password every time.

  5. 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:

  • Windows (in WSL or Git Bash):

    cat ~/.ssh/id_ed25519.pub | clip
    
  • macOS:

    tr -d '\n' < ~/.ssh/id_ed25519.pub | pbcopy
    
  • GNU/Linux (requires xclip):

    xclip -sel clip < ~/.ssh/id_ed25519.pub
    

Step 4: Add SSH Key on the Platform

  1. Log in to the d.run UI, and go to User CenterSSH Keys.

  2. Paste your SSH public key into the input field.

    <!-- ssh4

    ssh5

    • 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.