Secure Shell (SSH) is the protocol used to remotely operate Linux systems. If you need to do anything on your Linux system remotely, chances are, you will use SSH because it is the securest way to work on your Linux remotely.
Note: If you are on Windows, to follow along with these steps, download and install Git and open Git Bash. On a Mac or Linux, use the Terminal.
Step 1 : Open Terminal : On a Mac or Linux, open terminal. On Windows, use WSL, Putty or install Git and open Git Bash.
Step 2 : Using a password to log in? If you are using a password to log in, you will need the following details:
- your server’s IP
- username
- password
Type in the following in your terminal, press enter, then type your password to log in:
ssh username@your-ip
#Example:
ssh root@192.90.10.1
When typing in your password, there won’t be any output on screen.
The first time you try to access any server, you will receive a prompt asking you to accept it as an authentic server. Type yes to accept it, then enter your password.
Step 3 : Using an SSH key to log in? If your Linux server is set up to use SSH key authentication rather than password based authentication, you will need the following details to log in:
- your server’s IP
- username
- Private SSH key
Enter your details as shown below to log in:
ssh username@your-ip -i /location/to/the/private/key
#Example:
ssh username@your-ip
#Example:
ssh root@192.90.10.1 -i ~/.ssh/ubuntu_server_private_key
Step 4 : Possibility of a different port. If your SSH port has been changed from the default port (22), you will have to specify the SSH port when logging in.
#Example:
ssh root@192.90.10.1 -p 6500
#or
ssh root@192.90.10.1 -i ~/.ssh/ubuntu_server_private_key -p 6500