相关疑难解决方法(0)

将 SFTP 的启动文件夹设置为 /home/username 以外的其他权限会引发我的权限问题

我刚刚安装了一个基于 CentOS 的 SFTP 服务器。

我需要所有传入的文件都转到 /mnt/inbound/ 文件夹,因此我想确保来自该主机的每个通过 SFTP 登录的用户都将 /mnt/inbound/ 作为他们的起点,并且我想确保他们不能去其他任何地方。

我已经能够使用 SFTP 客户端与测试用户连接并确保用户被监禁在各自的文件夹中——但用户无法上传文件......

这是我到目前为止所做的:

  1. 创建一个名为 sftponly 的组以包含所有客户入站用户:

$ groupadd sftponly

  1. 修改 /etc/ssh/sshd_config 以使用 internal-sftp 子系统:

# Enable built-in implementation of SFTP Subsystem sftp internal-sftp

  1. 在 sshd_conf 的末尾添加以下内容:

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 …

ssh sftp

7
推荐指数
1
解决办法
4万
查看次数

标签 统计

sftp ×1

ssh ×1