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.
-
Make sure you have the private key file
*.pem, which is downloaded when installing the OS from VK Cloud images. -
Make sure the Bare Metal server is running and the OS boot process has completed, for example, via the VNC console.
-
If network filtering tools are used on the server (
ufw,nftables,iptables, etc.), add a rule to allow access via the SSH protocol (TCP port22). -
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
-
Open a terminal and set the permissions for the key file:
chmod 400 <KEY_FILE>Here
<KEY_FILE>is the path to the*.pemfile with the private key.Example for the key file
MyPrivateKey.pemlocated in the/path/to/file/directory:chmod 400 /path/to/file/MyPrivateKey.pem -
Connect to the server:
By external IP addressBy internal IP addressIf 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*.pemfile 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
yesin the command prompt and press ENTER.