In order to login to a user's account on machine with SSH you can use the command ssh username@ip_address
. It will ask for a password. If you type the correct password, you will be connected to the shell of that user on that machine. Otherwise it will prompt for the password again.
For example
root@dev10:~# ssh [email protected]
[email protected]'s password:
Welcome to Ubuntu 16.04 LTS (GNU/Linux 4.4.0-31-generic x86_64)
Last login: Fri Jul 22 18:33:27 2016 from 10.11.50.10
root@dev2:~#
If you want to use a specific ssh key to connect to a machine, use ssh -i /path/to/ssh_secret_key username@host
When you are connecting to a machine for the very first time, it will ask you to verify the fingerprint of the target machine. This is a security mechanism for avoiding a man-in-the-middle attack. You can see the fingerprint of the target machine by issuing this command in the target machine.
ssh-keygen -l -E md5 -f /etc/ssh/ssh_host_ecdsa_key.pub
You can type "yes" if both are same. It will proceed to password prompt.
Example:
root@dev10:~# ssh [email protected]
The authenticity of host '10.11.50.3 (10.11.50.3)' can't be established.
ECDSA key fingerprint is dd:a3:de:cd:5b:01:cd:0b:b6:bc:b3:09:c2:c8:1a:68.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.11.50.3' (ECDSA) to the list of known hosts.
[email protected]'s password:
Last login: Fri Jul 22 17:45:09 2016 from 10.11.1.71
root@dev2:~#