【ChrootDirectory】目的和用途:实现chroot
【ChrootDirectory】用法1:全局禁用,Match条件启用
#ChrootDirectory none # override default of no subsystems #Subsystem sftp /usr/libexec/openssh/sftp-server Subsystem sftp internal-sftp # Example of overriding settings on a per-user basis #Match User root,user2 # X11Forwarding no # AllowTcpForwarding no # ChrootDirectory none Match User user3 X11Forwarding no AllowTcpForwarding no ChrootDirectory /root/jin Match Group chroot X11Forwarding no AllowTcpForwarding no ChrootDirectory /root/jin
【ChrootDirectory】用法2:全局起用,Match条件禁用(比如,root例外)
ChrootDirectory /root/jin # override default of no subsystems #Subsystem sftp /usr/libexec/openssh/sftp-server Subsystem sftp internal-sftp # Example of overriding settings on a per-user basis Match User root,user2 X11Forwarding no AllowTcpForwarding no ChrootDirectory none
【ChrootDirectory】难点:必须自己手工准备这个“chroot directory”
【ChrootDirecory】注意事项:
牛X好用的sshd_config:ChrootDirectory
原文:https://www.cnblogs.com/jinzhenshui/p/14845232.html