在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
会出现类似如下内容:
2. 启动SFTP Server:
打开 System Preferences -> sharing,勾上"Remote Login",如下:
同样,测试sftp是否成功打开:
sftp localhost
会出现类似如下内容:
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
本文出自:http://www.foolgeek.com, 原文地址:http://www.foolgeek.com/2013/08/13/mac-os-x-%e4%b8%8a%e5%90%af%e5%8a%a8-ftpsftp-server%ef%bc%8c%e5%b9%b6%e8%ae%be%e7%bd%ae-log-level/, 感谢原作者分享。
页:
[1]