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

时间:2021-10-22 19:06:03

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

会出现类似如下内容: Mac OS X 上启动 FTP/SFTP server,并设置 log level

2. 启动SFTP Server:

打开 System Preferences -> sharing,勾上"Remote Login",如下: Mac OS X 上启动 FTP/SFTP server,并设置 log level 同样,测试sftp是否成功打开:

 sftp localhost

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

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