打开WEB文件管理器出现如下错误
通常是SSH的默认端口不是22的错误或者是配置没有开启文件夹权限!可用如下命令进行查看!
grep -riE 'sftp|AllowUsers|Authentication|UsePAM|Port' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/
会有以下输出(第17行)
/etc/ssh/sshd_config:Port 2974
/etc/ssh/sshd_config:# Authentication:
/etc/ssh/sshd_config:#HostbasedAuthentication no
/etc/ssh/sshd_config:# HostbasedAuthentication
/etc/ssh/sshd_config:ChallengeResponseAuthentication no
/etc/ssh/sshd_config:#KerberosAuthentication no
/etc/ssh/sshd_config:#GSSAPIAuthentication no
/etc/ssh/sshd_config:# Set this to 'yes' to enable PAM authentication, account processing,
/etc/ssh/sshd_config:# and session processing. If this is enabled, PAM authentication will
/etc/ssh/sshd_config:# be allowed through the ChallengeResponseAuthentication and
/etc/ssh/sshd_config:# PAM authentication via ChallengeResponseAuthentication may bypass
/etc/ssh/sshd_config:# and ChallengeResponseAuthentication to 'no'.
/etc/ssh/sshd_config:UsePAM yes
/etc/ssh/sshd_config:GatewayPorts no
/etc/ssh/sshd_config:Subsystem sftp internal-sftp
/etc/ssh/sshd_config:PasswordAuthentication yes
/etc/ssh/sshd_config:PubkeyAuthentication no
/etc/ssh/sshd_config:# Hestia SFTP Chroot
/etc/ssh/sshd_config:Match User sftp_dummy99,admin,www
/etc/ssh/sshd_config: ForceCommand internal-sftp
:::
如PubkeyAuthentication
字段为no
可编辑sshd
配置文件
nano /etc/ssh/sshd_config
配置文件里的PubkeyAuthentication no
字段为PubkeyAuthentication yes
然后保存!
也可使用 sed
命令一键修改
sed -i 's/^PubkeyAuthentication no/PubkeyAuthentication yes/' /etc/ssh/sshd_config
查看是否修改成功
grep -riE 'sftp|AllowUsers|Authentication|UsePAM|Port' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/
会有以下输出(第17行)
/etc/ssh/sshd_config:Port 2974
/etc/ssh/sshd_config:# Authentication:
/etc/ssh/sshd_config:#HostbasedAuthentication no
/etc/ssh/sshd_config:# HostbasedAuthentication
/etc/ssh/sshd_config:ChallengeResponseAuthentication no
/etc/ssh/sshd_config:#KerberosAuthentication no
/etc/ssh/sshd_config:#GSSAPIAuthentication no
/etc/ssh/sshd_config:# Set this to 'yes' to enable PAM authentication, account processing,
/etc/ssh/sshd_config:# and session processing. If this is enabled, PAM authentication will
/etc/ssh/sshd_config:# be allowed through the ChallengeResponseAuthentication and
/etc/ssh/sshd_config:# PAM authentication via ChallengeResponseAuthentication may bypass
/etc/ssh/sshd_config:# and ChallengeResponseAuthentication to 'no'.
/etc/ssh/sshd_config:UsePAM yes
/etc/ssh/sshd_config:GatewayPorts no
/etc/ssh/sshd_config:Subsystem sftp internal-sftp
/etc/ssh/sshd_config:PasswordAuthentication yes
/etc/ssh/sshd_config:PubkeyAuthentication yes
/etc/ssh/sshd_config:# Hestia SFTP Chroot
/etc/ssh/sshd_config:Match User sftp_dummy99,admin,www
/etc/ssh/sshd_config: ForceCommand internal-sftp
使用这个命令重启sshd
配置
systemctl restart sshd
然后登录 Hestia
面板的 WEB
界面进入文件管理器你会惊奇的发现没有错误显示了!