我刚刚安装了一个基于 CentOS 的 SFTP 服务器。
我需要所有传入的文件都转到 /mnt/inbound/ 文件夹,因此我想确保来自该主机的每个通过 SFTP 登录的用户都将 /mnt/inbound/ 作为他们的起点,并且我想确保他们不能去其他任何地方。
我已经能够使用 SFTP 客户端与测试用户连接并确保用户被监禁在各自的文件夹中——但用户无法上传文件......
这是我到目前为止所做的:
$ groupadd sftponly
# Enable built-in implementation of SFTP Subsystem sftp internal-sftp
Match Group sftponly # Force the connection to use the built-in SFTP support ForceCommand internal-sftp # Chroot the connection into the specified directory ChrootDirectory /mnt/inbound/%u # Disable network tunneling PermitTunnel no # Disable authentication agent forwarding AllowAgentForwarding no # Disable TCP …