Verified and Tested 09/27/2015
In this article we will walk you through on how-yo SSH into your Linux Server from another Linux Server. SSH is a cryptographic network protocol that was made to replace telnet and allows local computer to authenticate with a remote server.
Linux Server with SSH running.
Second Linux server with SSH running.
If you do not have a server already, check out our cloud hosting selection and spin a new server up in under 30 seconds.
How to SSH into your Linux Server from another Linux Server.
You will then be prompted to enter your Username and Password for the server. For security reasons, the password is not shown as you type.
Once logged into your first Linux server, to SSH into your second Linux server you will run the following command: ssh <ipaddress>. Below is an example.
By default, when a user is not specified, you will be connecting using your current user on the device initiating the SSH connection.
If you want to connect to the second Linux server but with a different user other than the root user, you would run the following command: ssh user1@<ipaddress>
When connecting to the second Linux server from the first Linux server for the first time, you will be prompted to add the server’s key fingerprint to the list of known hosts.
If you trust the second Linux server you are connecting to then you will type “yes” and press enter. Next, you will be prompted to enter the password of the user you are trying to use on the second Linux server. Once you enter the correct password, you will be logged into your second Linux server from the first Linux server.
Other fun commands when using SSH.
- If you are using a custom SSH port for the second Linux server, you would need to specify the port number.
ssh [email protected] -p222
2. Transfer SSH public key to another machine in one step
ssh-keygen; ssh-copy-id [email protected]; ssh [email protected]
This will allow you to login to your second Linux server without having to use a password next time.
Thank you for following along in this tutorial! Please check back for more updates and try one of Atlantic.Net’s best Cloud hosting solutions.