Wednesday, February 9, 2011

Passwordless SSH connection

Spend the whole day to figure out how it works = ="

This is the scenario where server A wants to establish a connection to B without keying password:

a) Log in Server A with user Id 'userA' and corresponding passowrd.

b) Create the keys in server 'A' with the following command.
/user/local/bin/ssh-keygen –t rsa

c) Copy the public key in id_rsa.pub file under HOME_DIRECTOR/.ssh directory of server 'A'

d) Copy the 'id_rsa.pub' file of server A to 'authorized_keys' file of server B in B's HOME_DIRECTORY/.ssh directory

e) Grant both .ssh/ of server A & B 700 (chmod -R 700 .ssh/)

f) Log into server 'A' with 'userA' user ID

g) Execute the sftp command for server B, eg. sftp userB@Bserver



No comments:

Post a Comment