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
