Eliminating password request for SSH for Linux and Oracle

Tags:
Enterprise Linux
Linux
I was trying to configure SSH on Oracle Linux. I have done the following steps on two nodes:
/usr/bin/ssh-keygen -t rsa
/usr/bin/ssh-keygen -t dsa 
Then I did this on node 1:
ssh node1 cat ~/.ssh/id_rsa.pub >> authorized-keys ssh node1 cat ~/.ssh/id_dsa.pub >> authorized-keys 
Then copied the authorized-keys to node 2
scp authorized-keys node2:/vol1/ora/.ssh
Then did this on node 2
ssh node2 cat ~/.ssh/id_rsa.pub >> authorized-keys ssh node2 cat ~/.ssh/id_dsa.pub >> authorized-keys
Then, I entered
/usr/bin/ssh-agent $SHELL
/usr/bin/ssh-add
when doing the ssh node1 to do the self test it is asking me password even after many attempts, neither the ssh connection to the node 2 is successful without passing the password. Kindly let me know what could be the reason for this.

Software/Hardware used:
Enterprise linux AS release 4 update 4 (kernel 2.6.9-42.0.0.0.1.Elhugemem)

Answer Wiki

Thanks. We'll let you know when a new response is added.

The ~/.ssh/id_rsa.pub from node1 needs to be added to the end of ~/.ssh/authorized_keys <b>on node2</b> and vice versa. The ~/.ssh/id_rsa.pub key from node1 does not need to be in ~/.ssh/authorized_keys on the same machine unless you plan to ssh from node1 back to node1, which is kind of pointless…

Then, ~/.ssh/authorized_keys must be owned by the user (whoever ~ is the home directory for) and should have a group of the user’s primary group and must have permissions of 600. Your scp probably did not set permissions to 600 and ssh will not use the key if it can be compromised.

Depending on the linux, /var/log/secure or or /var/log/messages should tell you exactly what sshd is doing and, if authentication is not granted, why it was denied.

Also, it may be a typo or something unique to your linux, but the file is generally called authorized_keys, not authorized-keys. If you got the file name wrong, it won’t work…

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Linux - Ask the Expert
    [...] the original here: &#69&#108&#105minating password request for SSH for Linux and Or&#97&#99&#108e Nessun tag per questo [...]
    0 pointsBadges:
    report
  • petkoa
    Is there any chance that /bin/ssh is asking not for password on other node, but for passphrase of the encrypted private key on the local node? If you need fully automatic connect you'd save private key unencrypted... By, Petko A.
    3,120 pointsBadges:
    report
  • Meredith Courtemanche
    For anyone currently having trouble with sshd on linux, we have a new tip on SearchDataCenter about configuring it to be more secure, by Sander van Vugt. You can read it here: http://searchdatacenter.techtarget.com/tip/Linux-sshd-customization-for-the-safest-remote-server-access
    1,235 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following