2009年8月5日水曜日

sshでログインできない

俺@仕事中です。
今日はインストール直後のサーバにSSHログイン出来なかった場合の起こりうるミスについてメモります。
※実際おこりました、、。

サーバ側の/var/log/messagesに
# less /var/log/messages
Aug 5 11:14:17 data1 sshd(pam_unix)[15652]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxx-xxx-xxx-x.yyy.yy-yyyyy.yy.jp user=foouser
Aug 5 11:14:30 data1 sshd(pam_unix)[15654]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxx-xxx-xxx-x.yyy.yy-yyyyy.yy.jp user=foouser
Aug 5 11:14:56 data1 sshd(pam_unix)[15657]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxx-xxx-xxx-x.yyy.yy-yyyyy.yy.jp user=foouser

/var/log/secureに
# less /var/log/secure
Aug 5 11:14:17 data1 sshd[15652]: User foouser not allowed because not listed in AllowUsers
が出てる時。

# vim /etc/ssh/sshd_config
AllowUsers allowedusername foouser # ←foouserを追加
して

# service sshd reload
したらログインできます。

以上どぇぇぇす。

0 件のコメント: