ssh no password prompt
hi all
i want to set up a cronjob that rsync's file on our web server so i need to setup ssh so that there is no login prompt i'm having issues though this is what i've tried m1 is the computer that needs to login and sync files m2 is the computer with the files root@m1 -> ssh-keygen -t dsa, no passphrase root@m1 -> scp id_dsa.pub remoteuser@m2:~/.ssh/authorized_keys still asks for password after that when i try root@m1 -> ssh-keygen -t dsa, no passphrase root@m1 -> scp id_dsa.pub root@m2:~/.ssh/authorized_keys there is no problem, exactly the same procedure, same files i've tried it with three different computers and it always works with root@m2 but never when it is user@m2 anyone have any ideas thanks dave |
Re: ssh no password prompt
Quote:
Code:
scp id_dsa.pub remoteuser@m2:~/.ssh/authorized_keys Code:
chown remoteuser remoteuser_home/.ssh/authorized_keys Giang Hu |
hi thanks for your reply
the authorized_keys files was copied to the user's .ssh directory i just typed in rush format and the authorized_keys file is owned by remoteuser |
Quote:
Code:
ssh remoteuser@server |
is this what you expected?
logged in as root@m1 shell root@m1] ssh remoteuser@m2 password: shell remoteuser@m2]cat ~/.ssh/authorized_keys it prints out the public key exactly the same as what it is on m1 |
Quote:
Code:
# login as localuser Giang Hu |
Check your directory permissions for the remote user's ~/.ssh directory. SSH is very picky about permissions. It should have only drwx.
|
hey thanks guys
miscgeek, you were on the money, .ssh directory permissions were the one it was 755 for the remote .ssh directory changed it to 700 and voila thanks again |
Quote:
|
Try this out
) Type the following script in a file named "sshlogin".
#!/usr/bin/expect -- set timeout 180 set machine [lindex $argv 0] set username [lindex $agrc 1] set password [lindex $argv 2] spawn ssh $username@$machine expect "$username@$machine's password: " send "$password\n" interact 2) Give executable permission to the file. chmod 711 sshlogin 3) put this file in /bin folder 4) Now for a user "abc" wants to login to a machine node1 using password "xyz", the command is : sshlogin node1 abc xyz I think this should solve your problem __________________ Vin.K -------- touch /proc/kcore |
All times are GMT -5. The time now is 12:33 PM. |