A few things, mostly technical notes...

Sunday, April 17, 2005

Setting up ssh equivalency between Linux hosts

Alright, most of the decent and latest Linux ssh are version 2. Hence I am to cut the crap and get directly onto how to get this to work.

Say, you have hostA, which should get to hostB as root without a password.

We got to tell hostB the public keys of hostA. We have to create keys first for hostA. Login as root onto hostA, and run:

# ssh-keygen -b 1024 -t dsa

This would created a file, id_dsa.pub mostly in $HOME/.ssh directory.

Cut and paste this file's contents onto a file authorized_keys2 in $HOME/.ssh/ directory of the other host.

If you are trying to get in as root, make sure that your sshd_config (usually it is /etc/ssh/sshd_config ) has "PermitRootLogin yes".

If you're making changes to sshd_config, make sure you restart sshd to bring those changes into effect. sshd can be restarted as "service sshd restart" as root.

Now, from hostA, run ssh hostB. If its the first time you're sshing to hostB, you may see a question like: "Are you sure you want to continue connecting (yes/no)? " , say yes, and bingo you're good to go...

No comments:

Followers


Creative Commons License
This work is licensed under a Creative Commons License.