Mac OS X 上启动 FTP/SFTP server,并设置 log level

 

1. 启动FTP Server:

命令行下,

 sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist

stop:

 sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist

确认已经启动:

 ftp localhost

会出现类似如下内容: 80D7F971-32E4-452E-A0C9-A91559C6AC87

2. 启动SFTP Server:

打开 System Preferences -> sharing,勾上"Remote Login",如下: 746126DE-2BDE-4A5E-AD3F-6236A739B3B2 同样,测试sftp是否成功打开:

 sftp localhost

A975895A-41C3-4613-8E90-93DF43CCF4E0

3. 设置log level:

打开 sshd_config,我这里是 "/etc/sshd_config", 找到类似该行: Subsystem sftp /usr/libexec/sftp-server 改成:Subsystem sftp /usr/libexec/sftp-server -l INFO INFO 就是log level,可能的level option有(从左到右,越来越详细): QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3

原文地址:https://www.cnblogs.com/SZLLQ2000/p/5534962.html