Install openssh-client first
sudo apt-get install openssh-client
Suppose
Computer A(192.168.1.111), Computer B(192.168.1.123)
Login Computer A
ssh-keygen -t [rsa|dsa]
this will generate: id_rsa, id_rsa.pub or id_dsa, id_dsa.pub
Copy the generated .pub to .ssh directory in Computer B
cat id_dsa.pub >> ~/.ssh/authorized_keys
or
cat id_rsa.pub >> ~/.ssh/authorized_keys
We can connect to Computer B in Computer A without password
ssh 192.168.1.123
Examples of ssh commands
ssh remote@192.168.1.120
ssh -i ~/.ssh/id_rsa david@abc.xyz.com
ssh -i ~/.ssh/id_dsa sam@50.17.138.101 -o ServerAliveInterval=60
(Solve Broken pipe problem:-o ServerAliveInterval=60)
Examples of scp commands
scp -r to-remote remote@192.168.1.120:~/to-remote (copy directory)
sudo scp -i ~/.ssh/id_rsa app.zip david@abc.xyz.com:~/app.zip (copy .zip package)