设置www用户密码:
passwd www
修改sshd配置:
nano /etc/ssh/sshd_config
在尾部增加如下配置:
Match User www
ChrootDirectory /www/wwwroot
ForceCommand internal-sftp
AllowTcpForwarding no
X11Forwarding no
最后
systemctl restart sshd
宝塔面板不知道为什么FTP很卡,我采用SFTP替代

设置www用户密码:
passwd www
修改sshd配置:
nano /etc/ssh/sshd_config
在尾部增加如下配置:
Match User www
ChrootDirectory /www/wwwroot
ForceCommand internal-sftp
AllowTcpForwarding no
X11Forwarding no
最后
systemctl restart sshd