cd /data/nfs-data mkdir aig-plugin aog-plugin chown -R nfs-sftpuser:sftp aig-plugin aog-plugin
vim /etc/ssh/sshd_config Subsystem sftp internal-sftp Match User nfs-sftpuser # 这行用来匹配sftp组的用户,如果要匹配多个组,多个组之间用逗号分割 匹配用户的话用 Match User sftpuser ChrootDirectory /data/nfs-data # 用chroot将用户的根目录指定到/data/sftp/%u,%u代表用户名,这样用户就只能在/data/sftp/%u下活动 ForceCommand internal-sftp # 指定sftp命令 AllowTcpForwarding no # 以下这两行,限制该用户使用端口转发 X11Forwarding no