Passwordless SSH

From INIwiki
Jump to: navigation, search

Digg this!

<meta name="keywords" content="linux, ssh, passwordless"></meta> <meta name="description" content="Configure passwordless ssh access across multiple machines"></meta>

Generate SSH Key on client machine.

# ssh-keygen -t dsa

Press enter for the next three questions. By default your key will be saved as id_dsa.pub in /home/user/.ssh/

Create a copy of your public key to a unique name that identifies the client host:

# cd /root/.ssh/
# cp id_dsa.pub id_dsa.pub.hostname

Send the file to the target host.

# rsync -rave ssh /root/.ssh/id_dsa.pub.hostname targethost:/root/.ssh/

On the target host copy the contents of the client host's key into the authorized_keys file.

# cat /root/.ssh/id_dsa.pub.hostname >> /root/.ssh/authorized_keys

Test a ssh connection from client to target. No password required!

Digg this!

Personal tools