/bin/log

Log my thoughts

Home About GitHub

18 Sep 2012
无力吐槽

公司online的server一直无法ssh自动登录。

debug方法如下:

#sshd debug on 2222
/usr/sbin/sshd -ddd -p 2222

try login from client

ssh user@host -v -p 2222

发现原因是 debug1: trying public key file /root/.ssh/authorizedkeys debug3: securefilename: checking ‘/root/.ssh’ debug3: secure_filename: checking ‘/root’ Authentication refused: bad ownership or modes for directory /root

sshd会检查目录权限,看了下server的root。 我彻底无语了。不知道之前哪个傻逼改成777???

drwxrwxrwx  18 root root   4096 Sep 18 18:37 root
#chmod 750 /root

Carpe diem,
JZR at 23:04

Home About GitHub