ssh 접속기록을 확인해야 하는 경우.
1. 설정파일
[root@brightforest /]# vi /etc/ssh/sshd_config
# Logging
SyslogFacility AUTH
#syslog 데몬에 의한 로그 facility를 지정. 기본값은 AUTH 그외 설정(DAEMON,USER,LOCAL0~7
LogLevel INFO
# 기타 로그레벨 [QUIET(기록하지않음) , FATAL(치명적오류) , ERROR,VERBOSE,DEBUGS]
2. 관련 로그 경로
[root@brightforest /]# vi /var/log/secure
#password 틀렸을 경우
May 3 11:25:24 sllee sshd[2793]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.77.xx.xx
May 3 11:25:24 sllee sshd[2793]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
#로그인 성공
May 3 11:25:50 sllee sshd[2793]: Accepted password for root from 10.77.xx.xx port 50086 ssh2
May 3 11:25:50 sllee sshd[2793]: pam_unix(sshd:session): session opened for user root by (uid=0)
#세션 끊긴 경우
May 3 11:26:09 sllee sshd[2793]: pam_systemd(sshd:session): Failed to release session: Interrupted system call
May 3 11:26:09 sllee sshd[2793]: pam_unix(sshd:session): session closed for user root
config 옵션 설명은 잘 설명된 블로그가 많음..
'Linux' 카테고리의 다른 글
[CentOS] yum repository 구성 (0) | 2021.05.27 |
---|---|
쉘 스크립트에서 sed 명령에 변수 사용하여 파일내 문자열 치환 (0) | 2021.05.06 |
[CentOS7] 마운트설정 fstab, rc.local (0) | 2020.06.24 |
[Linux] CentOS repository 설정 (0) | 2020.05.21 |
[Linux] CentOS NTP 설정 (0) | 2020.04.21 |