(3) 修改目录权限
# chown root.sftp /data/htdocs
# groupadd sftp
# useradd -d /data/htdocs -s /bin/false -g sftp koumm
# passwd koumm
说明: 目录属主一定要用root,否则无法登录。其它用户可以加入sftp组中,并且可以在/data/htdocs目录中创建可写文件夹实现文件上传。
(4) 重启sshd服务
# service sshd restart
Stopping sshd: [ OK ]
Starting sshd: /usr/local/etc/sshd_config line 74: Unsupported option GSSAPIAuthentication
/usr/local/etc/sshd_config line 76: Unsupported option GSSAPICleanupCredentials
/usr/local/etc/sshd_config line 87: Unsupported option UsePAM
[ OK ]
解决错误提示:
# vi /usr/local/etc/sshd_config
注释掉74,76,87行
#GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
#UsePAM yes
# service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]