Soft link and hard link in linux

Soft link has a different inode number and original file has different number. Soft link can link to a directory and the link will not have original file but shows the path.

Hard link has same inode number and will have original file contents. Removing the links will not affect original file contents. We cannot create a hard link to a directory.

Establishing ssh connection between two hosts in Linux

Consider two hosts A and B with user a on host A and user b on  host B. We are establishing a secure connection between these two hosts A and B for user a to login automatically without password to user b account on host B.

 

We first login on A as user a and we should generate a pair of authentication keys i.e, public and private keys. This is done as follows:
 
a@A: ssh-keygen -t rsa
 
Now we should create a directory .ssh as user b on host B.
 
a@A: ssh b@B mkdir-p .ssh
 
here it asks for b@B’s password.Enter the password.
 
Now we should copy the a’s public key to b@B:.ssh/authorized_keys.
 
a@A:cat .ssh/id_rsa.pub | ssh b@B ‘cat >> .ssh/authorized_keys
 
It will again ask for b@B’s password.Enter the password.
 
After this you can log into B as user b from A as user a without a password.
 
a@A: ssh b@B