我熟悉使用log show | grep 'sshd: error: PAM: authentication error for $user from $ip_address'来查看来自不同 IP 地址的失败登录尝试。
每当成功建立并验证 SSH 连接时是否会写入等效日志(理想情况下它将包含有关客户端 IP 地址的信息)。
我查看了我的日志文件,似乎没有记录成功登录的日志。
成功的 SSH 登录将使用以下命令登录/var/log/auth.log:
sshd[20007]: Accepted password for username from 192.0.2.123 port 60979 ssh2
sshd[20007]: pam_unix(sshd:session): session opened for user username by (uid=0)
systemd-logind[613]: New session 12345 of user username.
Run Code Online (Sandbox Code Playgroud)
或者,如果是公钥身份验证:
sshd[20008]: Accepted publickey for username from 192.0.2.123 port 50460 ssh2
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11965 次 |
| 最近记录: |