Password-less RSA Authentication not working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Password-less RSA Authentication not working
# 1  
Old 12-06-2010
Password-less RSA Authentication not working

Hello Friends,

I know this issue has been raised many times and hence I tried every resolution provided in the forum before I posted this issue again.

My Password-less RSA authentication was working fine for quite some time. Whenever the remote server password used to change I used to re-do the steps and things would have been fine. But today I tried the same steps but my authentication is not working and it is asking me the password again:


(1) Generated my local RSA Key:
cd $HOME
ssh-keygen -t rsa (No passphrase provided)
(2) Copied the id_rsa.pub file in the remote server home directory
scp .ssh/id_rsa.pub username@remoteserver:~
password: <Provided the password>
(3) Logged in to the remote server to add the content of the id_rsa.pub file to the authorized keys file
ssh username@remoteserver
password: <Provided the password>
cat id_rsa.pub >> .ssh/authorized_keys
chmod 700 .ssh
chmod 644 authorized_keys
exit
(4) In Local Server
cd $HOME
chmod 700 *
(5) Previously after Step 4 when I used to login to the remote server I was not asked for any password, but Smilie
ssh username@remoteserver
Password: <Enter Password>

Please help me in this regard
# 2  
Old 12-06-2010
Continuation....

I have attached the debug messages generated using the following commands:
File "Debug_Message_1_Verbose.txt" -- ssh -v username@remoteserver
File "Debug_Message_2_Verbose.txt" -- ssh -vv username@remoteserver
# 3  
Old 12-06-2010
Friends,
Any idea on the above issue. Please do let me know if I should provide any more required information.
# 4  
Old 12-07-2010
please check if the keys entry are available at both communicating servers
This User Gave Thanks to nchourasiya For This Post:
# 5  
Old 12-07-2010
I think you need to add the user to /etc/sudoers

as below


PHP Code:
# Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL 
user                ALL=(ALL)       NOPASSWDALL 
This User Gave Thanks to kalyankalyan For This Post:
# 6  
Old 12-07-2010
The problem just got resolved, I just found out that the following permission setting needs to be maintained:
remote server:
home directory - should have permission 755
.ssh directory - should have permission 700
files inside .ssh directory - should have permission 600
It seems if the directory/files are writtable by other users, SSHD simply disregards the rsa/dsa keys.
Thanks nchourasiya,kalyankalyan for your suggestions.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Password Less Authentication not Working After Giving Full Permission

Hello Team, Please help me to solve my Problem, By mistake, I give full permission to /(root) directory. by using the following command "chmod -R 777 /" after this, the client asks for the password to login via ssh. Before that, I an able to Login without a password. Please help me to retrieve... (5 Replies)
Discussion started by: Shubham1182
5 Replies

2. UNIX for Dummies Questions & Answers

[SSH-RSA] Still prompting for password after generating keys

Hello, I'm trying to perform these operations without entering any password, as user "fzd":fzd@machine1> scp /tmp/srcFile1 fzd@machine2:/tmp/$destFile fzd@machine1> scp fzd@machine2:/tmp/$srcFile /tmp/$destFilebut alsofzd@machine1> scp /tmp/srcFile1 machine2:/tmp/$destFile fzd@machine1> scp... (6 Replies)
Discussion started by: fzd
6 Replies

3. UNIX for Advanced & Expert Users

Need Password-Less ssh with RSA-VPN

We have RSA SecureID softtoken key generator on my Windows machine. It generates new keys every 1 minute. Any HPUX server (be it ServerD or ServerP) requires my ID and the randomly generated RSA SecureID softtoken key from my Windows to login. I login to ServerD. Then I run a script... (0 Replies)
Discussion started by: mohtashims
0 Replies

4. UNIX for Dummies Questions & Answers

Without password via RSA algorithm problem

hi All, i need to connect(sftp) from serverA to serverB via rsa algorithm. But i can not success this. i did like that: On ServerA: #ssh-keygen -t rsa after running this command, "id_rsa" and "id_rsa.pub" files were generated. i checked.there is private key in id_rsa file and... (8 Replies)
Discussion started by: temhem
8 Replies

5. UNIX for Advanced & Expert Users

RSA keys are not working

Hi, We have two open SSh systems(Let us assume that A and B).These systems are having the non expiring passwords. We established a passwordless connection between two systems bu using the rsa key iles. I have created the key generated files by using the command ssh-keygen -t rsa in system A and... (1 Reply)
Discussion started by: srrao.ch
1 Replies

6. Shell Programming and Scripting

RSA keys are not working

Hi, We have two open SSh systems(Let us assume that A and B).These systems are having the non expiring passwords. We established a passwordless connection between two systems bu using the rsa key iles. I have created the key generated files by using the command ssh-keygen -t rsa in system A and... (1 Reply)
Discussion started by: srrao.ch
1 Replies

7. Shell Programming and Scripting

SFTP in Shell Script with RSA-KEY or password.

I am trying to SFTP to a couple sites. One has an RSA-KEY that was sent to me. Currently I am running that manually using WinSCP. I would like to set it up as a CRON process on our Linux host (Sun). Can I use the rsa-key they sent me in any directory or does it need to be placed in a specific... (2 Replies)
Discussion started by: alemat
2 Replies

8. UNIX for Dummies Questions & Answers

SSH with RSA keys - error contacting the authentication agent

Hi all, Basic Requirement: To SFTP large files (usually 10GB). We use webMethods 6.1.2 (installed on Unix) as the orchstrator and make underlying Unix system calls to do the processing. That is, if we have to SFTP a large file - webMethods will invoke a Perl script on the underlying Unix... (2 Replies)
Discussion started by: sandeeppotdar
2 Replies

9. UNIX for Advanced & Expert Users

ssh RSA authentication failure

I am using an ssh pub key on two remote servers to allow ssh session without authentication. Both servers have the same id_rsa.pub copied from the host into the remote servers ~user/.ssh/authorized_keys. There is no passphrase for this key either. The problem is that I am able to ssh into one... (2 Replies)
Discussion started by: prkfriryce
2 Replies

10. UNIX for Advanced & Expert Users

How do I enable RSA authentication (i've already read the FreeBSD handbook on this...

I followed the directions under 10.10.6, but nothing seems to have happened. When I try logging in, nothing has changed. I still login using my username/password combination. I've already created the keyparis, but why isn't this working? What I'm looking to do is to put the pub keypair... (2 Replies)
Discussion started by: xyyz
2 Replies
Login or Register to Ask a Question