VK Cloud logo

Connecting to a Bare Metal Server with Linux OS

SSH is the most common and secure way to connect to a server with a Linux OS. It supports two main authentication methods:

  • By password: disabled by default in VK Cloud images for security reasons.
  • Using an SSH key: the most secure connection method. Used by default in VK Cloud images.

Preparatory steps

  1. Make sure you have the private key file *.pem, which is downloaded when installing the OS from VK Cloud images.

  2. Make sure the Bare Metal server is running and the OS boot process has completed, for example, via the VNC console.

  3. If network filtering tools are used on the server (ufw, nftables, iptables, etc.), add a rule to allow access via the SSH protocol (TCP port 22).

  4. Make sure the SSH service on the Bare Metal server is started and running. You can check the service status using the command:

    sudo service sshd status

Connecting to a Bare Metal server

  1. Open a terminal and set the permissions for the key file:

    chmod 400 <KEY_FILE>

    Here <KEY_FILE> is the path to the *.pem file with the private key.

    Example for the key file MyPrivateKey.pem located in the /path/to/file/ directory:

    chmod 400 /path/to/file/MyPrivateKey.pem
  2. Connect to the server:

    If your server is configured for connection via an external IP address (for example, through an advanced router), run the command:

    ssh -i <KEY_FILE> \       <USERNAME>@<SERVER_EXTERNAL_IP_ADDRESS>

    Here:

    • <KEY_FILE> — the path to the *.pem file with the private key.
    • <USERNAME> — the default account name, which is used in VK Cloud images.
    • <SERVER_EXTERNAL_IP_ADDRESS> — the IP address configured for connecting to the server from outside.

    If this is the first connection, a confirmation request will appear:

    The authenticity of host 'XXX.XXX.XXX.XXX (XXX.XXX.XXX.XXX)' can't be established.ECDSA key fingerprint is SHA256:aYZIWs9N6KRtfFOuic6eoWcluhSp6+j************Are you sure you want to continue connecting (yes/no)?

    Type yes in the command prompt and press ENTER.

Was this article helpful?