반응형

1. /etc/ssh/sshd_config 수정

[root@localhost ~]# vi /etc/ssh/sshd_config

# override default of no subsystems
Subsystem       sftp    /usr/libexec/openssh/sftp-server -f local2 -l INFO

 

2. sshd 재시작

[root@localhost ~]# systemctl restart sshd

 

3. /etc/rsyslog.conf 수정

[root@localhost ~]# vi /etc/rsyslog.conf

#sftp log
local2
.*                                                /var/log/sftp.log

 

4. rsyslog 재시작

[root@localhost ~]# systemctl restart rsyslog

 

5. sftp.log 파일 생성 및 로그 확인

[root@localhost ~]#touch /var/log/sftp.log

[root@localhost ~]#tail -f /var/log/sftp.log

Mar 26 11:47:28 is sftp-server[18171]: session opened for local user root from [192.168.0.100]
Mar 26 11:47:28 is sftp-server[18171]: opendir "/root"
Mar 26 11:47:29 is sftp-server[18171]: closedir "/root"

 

반응형

'Server > CentOS' 카테고리의 다른 글

[CentOS] 명령어 기록하기  (0) 2021.07.02
[CentOS] Core 파일  (0) 2021.02.03
[CentOS] Google OTP를 활용한 SSH 추가 인증  (1) 2021.01.13
[CentOS] is not in the sudoers file  (0) 2021.01.11
[CentOS] 로그인 실패시 계정 잠금  (0) 2021.01.07

+ Recent posts