SFTP:Directive ‘UseDNS‘ is not allowed

在安装sftp过程中,报错

/etc/ssh/sshd_config line 150: Directive 'UseDNS' is not allowed wi

解决办法:
把自己添加的

Subsystem       sftp    internal-sftp
Match Group sftp
ChrootDirectory /home/sftp
ForceCommand    internal-sftp
AllowTcpForwarding no

写在

# Example of overriding settings on a per-user basis
#Match User anoncvs
#       X11Forwarding no
#       AllowTcpForwarding no
#       PermitTTY no
#       ForceCommand cvs server
UseDNS no

之后

# override default of no subsystems
#Subsystem      sftp    /usr/libexec/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#       X11Forwarding no
#       AllowTcpForwarding no
#       PermitTTY no
#       ForceCommand cvs server
UseDNS no
AddressFamily inet
PermitRootLogin yes
SyslogFacility AUTHPRIV
PasswordAuthentication yes

Subsystem       sftp    internal-sftp
Match Group sftp
ChrootDirectory /home/sftp
ForceCommand    internal-sftp
AllowTcpForwarding no

重启成功

猜你喜欢

转载自blog.csdn.net/qq_42224683/article/details/112172295