ssh handshake without user interaction
1. create the identity.pub file, u can use dsa as well instead of rsa.ssh-keygen -t rsa
provide the passphrase or keep it blank.
2. upload your id_rsa.pub file as ~/.ssh/authorized_keys to the remote host
eg: if u want to upload to a host called boo
scp ~/.ssh/id_rsa.pub boo:.ssh/authorized_keys
3. set your local and remote .ssh directory's permission to 700
4. set your remote authorized_keys file's permission to 600
5. set local id_rsa file's permission to 600
6. set local id_rsa.pub and known_hosts permission to 644
now you can just do 'ssh boo' without giving a login password. but if
you have given a passphrase it will ask for it.
you can save your passphrase by 'ssh-add' util.
7.
sris@sris:~/projects$ ssh-add
Enter passphrase for /home/sris/.ssh/id_rsa:
Identity added: /home/sris/.ssh/id_rsa (/home/sris/.ssh/id_rsa)
now you have the luxary to do
1. ssh boo
2. scp file.txt sris@boo:
without providing a passwd or passphrase.
8 If you add your key to the remote host's role account, you have to
concatenate your key with the existing ones.
cat id_rsa.pub >> authorized_keys
this will ensure other user's key will not be replaced by yours.
0 Comments:
Post a Comment
<< Home