Neo*_*aru 5 ssh sshd public-key-encryption private-key password-protection
我的服务器上的 SSHD 遇到了一些问题。我正在尝试设置无密码(pub/pv 密钥)身份验证。它适用于我的其他服务器,但不适用于此服务器。SSHD 代理将我的公钥添加到“授权密钥”中,但仍要求输入密码。我试图完全禁用密码身份验证(在 /etc/ssh/sshd_conf 中)以查看会发生什么,但我得到了“错误的 pub 密钥”。
pub 密钥由客户端发送 (ssh -vvv):
----
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/me/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/me/.ssh/id_dsa
----
## Next key (rsa was the good one)
Run Code Online (Sandbox Code Playgroud)
我检查了“sshd_config”和“.ssh”权限现在我只想能够看到服务器端发生了什么。我检查了我的“/var/log/auth”和“/var/log/secure”,但这里没有文件。
在配置中,我配置日志如下:
SyslogFacility AUTH
LogLevel DEBUG
Run Code Online (Sandbox Code Playgroud)
如何在不使用深度网络嗅探的情况下调试我的情况?是否可以将 Sshd 输出重定向到日志文件或 std ?
谢谢
查看服务器上发生的情况的方法是使用以下选项启动 sshd 守护进程:
/usr/sbin/sshd -dD
Run Code Online (Sandbox Code Playgroud)
这两个选项是(来自手册页):
-D 当指定此选项时,sshd 将不会分离并且不会成为守护进程。这样可以轻松监控 sshd。
Run Code Online (Sandbox Code Playgroud)-d Debug mode. The server sends verbose debug output to standard error, and does not put itself in the background. The server also will not fork and will only process one connection. This option is only intended for debugging for the server. Multiple -d options increase the debugging level. Maximum is 3.
这应该足够了。对于过去,这取决于您的发行版。我在 /var/log/auth.log 中收到消息,但您可以通过以下方式在同一目录中搜索与 ssh 相关的消息
find /var/log -type f -exec grep -l ssh {} \;
Run Code Online (Sandbox Code Playgroud)
这将输出包含表达式的所有文件的名称ssh。然后您将必须检查它们的内容。
| 归档时间: |
|
| 查看次数: |
13336 次 |
| 最近记录: |