Connect To A Remote Server Via SSH
If you have an SSH key pair and a web server with the public portion of that key pair installed on it, you’re ready to connect to that server via SSH. The command is broken down below, the video provides a detailed walkthrough of the process.
Connect Via SSH
Open the Terminal program on your computer and enter the following command:
ssh -i ~/.ssh/25monkeys-do root@143.198.116.106 RETURN
Once you hit the return key, it will connect you securely to your server via SSH and display a welcome message.
If you’re interested in what the parts mean:
ssh -i ~/.ssh/25monkeys-do root@143.198.116.106
Use the SSH (Secure Shell) networking protocol.
ssh -i ~/.ssh/25monkeys-do root@143.198.116.106
Use an identity file (the private portion of your SSH key pair).
ssh -i ~/.ssh/25monkeys-do root@143.198.116.106
The path to the location of the private portion of your SSH key pair on your local computer.
ssh -i ~/.ssh/25monkeys-do root@143.198.116.106
Your username on the remote web server (root is often the default).
ssh -i ~/.ssh/25monkeys-do root@143.198.116.106
The IP address of the remote web server.
If you’ve just connected to a new server, one of the first things to do is to create a new non-root user so that all the changes you make going forward will be done with the correct permissions and security.