我正在尝试为我在 DigitalOcean Ubuntu 12.04 服务器上使用厨师创建的用户帐户设置 ssh 访问权限。我在 DigitalOcean 中设置了选项,以便在创建 Droplet 时自动复制我的 mac 的 ssh 密钥。
我可以毫无问题地以 root 身份登录,但我的其他用户无法进行身份验证。这似乎是一个常见问题,我检查了其他一些答案,并找到了此命令以获取更多信息:
ssh -vvv -i id_rsa user@serverIP
Run Code Online (Sandbox Code Playgroud)
使用该命令的 root 用户(成功)的日志是
调试
1: Offering RSA public key: /Users/evan/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp snip!
debug3: sign_and_send_pubkey: snip!
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Run Code Online (Sandbox Code Playgroud)
失败的用户:
调试
1: Authentications that can continue: publickey
debug3: …
Run Code Online (Sandbox Code Playgroud) 几周前,我在这里发布了一个关于ssh
我在 Ubuntu 12.04 机器上遇到的一些问题的问题。快进到今天,我试图允许其他人访问该机器,但他们不断收到密码错误。我结帐以var/logs/auth.log
获取更多信息,并发现了这一点:
May 11 19:45:33 myserver sshd[9264]: Did not receive identification string from 211.110.xxx.x
May 11 19:45:38 myserver sshd[9267]: Did not receive identification string from 211.110.xxx.x
May 11 19:45:44 myserver sshd[9270]: Did not receive identification string from 211.110.xxx.x
May 11 19:45:49 myserver sshd[9274]: Did not receive identification string from 211.110.xxx.x
Run Code Online (Sandbox Code Playgroud)
我有将近 10000 行似乎都或多或少地说了相同的事情(还有 4 个 auth.log.gz 文件,我假设它们更多相同?)。有时会有一个随机的用户名附加到请求中,input_userauth_request: invalid user bash [preauth]
我对服务器不太了解,但看起来有人试图访问我的服务器。
谷歌搜索如何在 Ubuntu 中阻止 IP 地址并最终得到这个:iptables -A INPUT -s 211.110.xxx.x -j …