Results 1 to 3 of 3
Hi,
I need to set up password less ssh between two machines
for a non root user(say foo) in order to write some
scripts for automating some mundane tasks.
To ...
- 08-21-2009 #1
Password less ssh for non root user
Hi,
I need to set up password less ssh between two machines
for a non root user(say foo) in order to write some
scripts for automating some mundane tasks.
To do this i tried following, but is not working
<Machine 1>
[root@peer1] useradd foo
[root@peer1] su foo
[foo@peer1] mkdir -p /home/foo/.ssh
[foo@peer1] chmod 700 /home/foo/.ssh
[foo@peer1] ssh-keygen -t rsa -b 1024 -N '' -P '' -f <--- for non interactive empty passphrase
[foo@peer1] exit
[root@peer1] scp /home/foo/.ssh/id_rsa.pub root@peer2:/tmp/
password less ssh is already enabled for root user on peer2.
<Machine 1>
<Machine 2>
[root@peer2] useradd foo
[root@peer2] mkdir -p /home/foo/.ssh
[root@peer2] cat /tmp/id_rsa.pub >>/home/foo/.ssh/authorized_keys
[root@peer2] chown -R foo /home/foo/.ssh
[root@peer2] chgrp -R foo /home/foo/.ssh
<Machine 2>
Please let me know, what am i missing here.
I've root privileges on both these two machines(peer1 and peer2)
and the user 'foo' doesn't exist until i add him.
Thanks,
amit
- 08-21-2009 #2Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
On machine 2:
1) Make sure permissions on /home/foo/.ssh is 700
2) Make sure /home/foo/.ssh/authorized_keys is owned by foo and permissions is 600
- 08-25-2009 #3
Thanks lomcevak !
After changing the permissions as you've mentioned, it worked


Reply With Quote