
log show | grep 'sshd: error: PAM: authentication error for $user from $ip_address'
다양한 IP 주소에서 실패한 로그온 시도를 조사하는 데 를 사용하는 데 익숙합니다 .
성공적인 SSH 연결이 설정되고 인증될 때마다 기록되는 동등한 로그가 있습니까(이상적으로는 클라이언트 IP 주소에 대한 정보가 포함됩니다).
내 로그 파일을 살펴봤지만 성공적인 로그인을 기록하는 로그는 없는 것 같습니다.
답변1
성공적인 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.
또는 공개키 인증의 경우:
sshd[20008]: Accepted publickey for username from 192.0.2.123 port 50460 ssh2