Log in to your myVesta control panel and navigate to the USER/EDIT/SSH access section.
Under the SSH access settings, ensure that you have selected 'bash' as the shell for your user account. This setting is crucial for SSH functionality and ensures that you have the proper shell environment for secure access.
Now, let's proceed with configuring SSH access for your specific user account and enabling public key authentication:
Open your terminal and establish an SSH connection as the root user. This will grant you administrative privileges to perform the necessary actions:
Code: Select all
ssh root@your_server_ip
After successfully connecting to your server, execute the following commands to set up SSH access with public key authentication. Replace "test" with the actual username for which you want to enable SSH access:
Code: Select all
USER='test'
cd /home/$USER
mkdir .ssh
chown $USER:$USER .ssh
chmod 0700 .ssh
cd .ssh
touch authorized_keys
chown $USER:$USER authorized_keys
chmod 0600 authorized_keys
Now, it's time to add your public key to the authorized_keys file. You can use a text editor to achieve this. In this example, we'll use the mcedit text editor, but you can use your preferred text editor:
Code: Select all
mcedit /home/$USER/.ssh/authorized_keys
By following these steps, you have successfully configured SSH access for a specific user account using a public key instead of a password. This enhances security and simplifies the authentication process when connecting to your server.