我试图使用“internal-sftp”在solaris 10上启用SFTP文件传输的日志logging(没有任何opentools的帮助),但看不到有关文件传输的任何信息。 请帮忙。
**#Argument in SSHD_CONFIG** Subsystem sftp internal-sftp -f AUTH -l DEBUG
我在/ var / log / sftplogging中看到的所有内容如下所示
Nov 15 15:15:17 test-server sshd[6032]: [ID 800047 auth.debug] debug1: open id 8 name /home/.sh_history flags 26 mode 0600 Nov 15 15:15:17 test-server sshd[6032]: [ID 800047 auth.debug] debug1: sent handle id 8 handle 0 Nov 15 15:15:17 test-server sshd[6032]: [ID 800047 auth.debug] debug1: write id 9 handle 0 off 0 len 948 Nov 15 15:15:17 test-server sshd[6032]: [ID 800047 auth.debug] debug1: sent status id 9 error 0 Nov 15 15:15:17 test-server sshd[6032]: [ID 800047 auth.debug] debug1: close id 9 handle 0 Nov 15 15:15:17 test-server sshd[6032]: [ID 800047 auth.debug] debug1: sent status id 9 error 0
我需要什么:我需要有以下格式的logging器
May 27 05:58:16 test-server internal-sftp[20050]: session opened for local user test-user from [192.168.1.1] May 27 05:58:16 test-server internal-sftp[20050]: received client version 3 May 27 05:58:16 test-server internal-sftp[20050]: realpath "." May 27 05:58:21 test-server internal-sftp[20050]: opendir "/home/test-user/" May 27 05:58:21 test-server internal-sftp[20050]: closedir "/home/test-user/" May 27 05:58:21 test-server internal-sftp[20050]: lstat name "/home/test-user/upload" May 27 05:58:21 test-server internal-sftp[20050]: realpath "/home/test-user/upload/" May 27 05:58:21 test-server internal-sftp[20050]: stat name "/home/test-user/upload" May 27 05:58:24 test-server internal-sftp[20050]: open "/home/test-user/upload/test-file.pdf" flags WRITE,CREATE,TRUNCATE mode 0664 May 27 05:58:25 test-server internal-sftp[20050]: close "/home/test-user/upload/test
老问题链接: SFTP日志logging:有没有办法?
解决了
1)创build一个父目录(虚拟),并创build日志,conslog,空和零文件使用mknod根据我的系统configuration(检查ls -ltr / dev / log ..为所有上述文件获取主要和次要号码)。
2)一旦完成,为每个被监禁的用户“/ chroot / dev /”创build一个“dev”文件夹,并为“/ virtual /”中的所有文件创build硬链接为ln -f / virtual / * / chroot / dev /。
3)创build“/ dev / log”到“/ virutal / log”的软链接为ln -sf / virtual / log / dev / log
重新启动syslogd守护程序,您可以在select的目录中看到Jailed用户的所有SFTP传输日志。