SSH / SCP key authentication

Many time bash scrip demands scp. OR you may not wish to enter password every time you access remote server.

Generate key for local system.

ssh-keygen -t dsa

Copy key to remote server.

ssh-copy-id -i /root/.ssh/id_dsa.pub root@192.168.1.1

Now you can ssh / scp without entering password.

For old system not equipped with ssh-copy-id

ssh-keygen -t rsa
scp ~/.ssh/id_rsa.pub root@192.168.1.1:
ssh root@192.168.1.1 ‘cat id_rsa.pub >> .ssh/authorized_keys’

Read 368 articles by

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Archives

Categories

Page optimized by WP Minify WordPress Plugin