Uxrt & Lxrt Archives

passwordless ssh not working on rhel5

Was doing automation test, trying to set up passwordless ssh between the dirver and couple of test nodes. it just didn't work with one rhel5 box. Finally find the solution:

[root@perlrh5-179 .ssh]# tail -n 10 /var/log/secure
Dec 4 12:39:56 perlrh5-179 sshd[9397]: Authentication refused: bad ownership or modes for directory /root
Dec 4 12:39:59 perlrh5-179 sshd[9398]: Connection closed by 10.200.58.179
...

log shows the issue was the permission of the root dir

drwxrwxr-x 20 root root 4096 Nov 25 10:08 root

change it to 700 and the issue was…

find and exec

first we can use find's exec opiton

find . -name CVS -exec ls -dl {} \;

also we can use shell

for i in `find . -name CVS` ; do echo -n $i," "; done

change ls, echo to whatever suits you, like rm -rf

cmd to compare contents of two directories

diff -qr dir1 dir2

About Michael Li

user-pic I blog issues resolved at work