Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
05-22-2005, 12:01 AM
#1
Member
Registered: Nov 2004
Distribution: fc4
Posts: 104
Rep:
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
Last edited by dtra; 05-22-2005 at 01:18 AM .
05-22-2005, 12:54 AM
#2
Member
Registered: Oct 2004
Location: somewhere in the street
Distribution: Window$
Posts: 192
Rep:
Re: ssh no password prompt
Quote:
Originally posted by dtra
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
You should copy to userdirectory
Code:
scp id_dsa.pub remoteuser@m2:~/.ssh/authorized_keys
Make sure
authorized_keys owner by
remoteuser . @ server:
Code:
chown remoteuser remoteuser_home/.ssh/authorized_keys
chmod 600 remoteuser_home/.ssh/authorized_keys
Good luck,
Giang Hu
05-22-2005, 01:17 AM
#3
Member
Registered: Nov 2004
Distribution: fc4
Posts: 104
Original Poster
Rep:
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
05-22-2005, 01:28 AM
#4
Member
Registered: Oct 2004
Location: somewhere in the street
Distribution: Window$
Posts: 192
Rep:
Quote:
Originally posted by dtra
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
Your
remoteuser@server had difference uid with
remoteuser@client , I think. Try out:
Code:
ssh remoteuser@server
Password:
cat ~/.ssh/authorized_keys
What does it say? (Dont tell me "Permission denied")
05-22-2005, 01:42 AM
#5
Member
Registered: Nov 2004
Distribution: fc4
Posts: 104
Original Poster
Rep:
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
05-22-2005, 02:22 AM
#6
Member
Registered: Oct 2004
Location: somewhere in the street
Distribution: Window$
Posts: 192
Rep:
Quote:
Originally posted by dtra
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
Its seemed really strange
. I had tested (with normal user) on my network and everything go right :-o
Code:
# login as localuser
[localuser@knoppix ~] ssh-keygen -t dsa
[localuser@knoppix ~] ssh remoteuser@gentoo mkdir ~/.ssh
Password:
[localuser@knoppix ~] scp id_dsa.pub remoteuser@gentoo:~/.ssh/authorized_keys
[localuser@knoppix ~] ssh remoteuser@gentoo ls
[localuser@knoppix ~]
Could you try again? (remove remoteuser .ssh dir before try)
Giang Hu
Last edited by freegianghu; 05-22-2005 at 02:23 AM .
05-22-2005, 03:45 AM
#7
Member
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189
Rep:
Check your directory permissions for the remote user's ~/.ssh directory. SSH is very picky about permissions. It should have only drwx.
05-22-2005, 04:52 AM
#8
Member
Registered: Nov 2004
Distribution: fc4
Posts: 104
Original Poster
Rep:
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
05-22-2005, 06:44 AM
#9
Member
Registered: Oct 2004
Location: somewhere in the street
Distribution: Window$
Posts: 192
Rep:
Quote:
Originally posted by dtra
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
Congratulation, but have you ever tried change back permission to 755?
05-25-2005, 01:08 PM
#10
LQ Newbie
Registered: Apr 2005
Distribution: RedHat
Posts: 17
Rep:
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 01:55 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News