Skip to main content

Connect to a notebook using SSH

When creating a notebook, you can enable SSH access to securely connect remotely, transfer files, and perform tasks.

info

SSH access to notebooks is supported only for default images. For a list of default images, see Supported notebook images.

Configure SSH​

  1. When creating a notebook, enable Enable SSH Connection at the bottom.

    info

    If you do not assign a volume to /home/{user-name}, the user directory created for SSH access, its contents may be lost when you stop and restart the notebook.

    To keep your work safe, use a directory with a mounted volume or assign a volume to the user directory as shown in the image.

    Image. Enable SSH Connection Enable SSH Connection

  2. After the notebook is created, hover over Use SSH in the menu and note the random port displayed in the SSH command.

    Image. Check the random SSH port Check the random SSH port

  3. From the left menu of the dashboard, click Manage Account and check the SSH Password.

    info

    The same SSH password is visible to all users in the same Namespace.

  4. Connect using SSH from your local terminal.

    info
    • When prompted with Are you sure you want to continue connecting (yes/no/[fingerprint])?, enter yes.
    • The username for SSH access is the username included in the notebook creator's email address. To add a user, log in with the notebook creator's account and run the adduser command.

    Image. Connect using SSH Connect using SSH

Verify SSH service status​

Run the following command in the notebook terminal to verify that the SSH service is running properly.

SSH service running normally
$ sudo service ssh status
* sshd is running

Use SCP​

  1. Check the port and account information required for SCP.

    info

    To use SCP, Enable SSH Connection must be enabled when you create the notebook.

    Image. Check the random SSH port Check the random SSH port

  2. Run the SCP command in your local terminal.

    info
    • Enter scp -P {SSH command random port} {Source File PATH} {Username@Domain}:{Destination PATH}.
    • When prompted with Are you sure you want to continue connecting (yes/no/[fingerprint])?, enter yes.

    Image. SCP command example SCP command example

  3. From the left menu of the dashboard, click Manage Account and check the SSH Password.

    info

    You can find the SSH password under SSH Password in Manage Account.

  4. In the Jupyter Notebook CLI, verify the file transferred by the SCP command from your local terminal.

    info
    • If you specify the user home directory as shown in the example, the file is saved to /home/{user-name}, which is created when you connect using SSH.
    • Specify Destination PATH to transfer the file to a directory of your choice.

    Image. Verify the SCP result Verify the SCP result