【问题标题】:Restricting a user for FTP限制 FTP 用户
【发布时间】:2017-03-23 22:30:25
【问题描述】:

我将如何将用户限制到指定的文件夹,例如 /var/www/html/ 我已经将此位置作为 FTP 的默认登陆位置,但我需要将它们专门限制在此位置,我不希望他们能够通过服务器返回并查看此位置以外的任何内容。

【问题讨论】:

  • 你运行的是什么服务器操作系统?
  • 你的问题是off-topic这里。

标签: apache ftp server restrict vsftpd


【解决方案1】:

一般来说,这个问题的解决方法叫做chroot

基本上,您要做的是设置 vsftpd 并确保设置 chroot_local_user=YES 已打开。

然后,用户将只能访问他们的主目录。这对您来说可能过于笼统,因为它广泛适用于所有用户。

https://unix.stackexchange.com/questions/94603/limit-ftp-access-only-to-the-var-www-with-vsftpd

您可以更精细地控制哪些用户使用 sftp 进行 chroot。

在这种情况下,您需要安装 openssh,将您想要 chroot 的所有用户放入特定组,然后确保设置了以下设置:

Subsystem     sftp   internal-sftp
Match Group NAME_OF_GROUP_TO_CHROOT
    ChrootDirectory %h
    ForceCommand internal-sftp
    AllowTcpForwarding no

http://www.techrepublic.com/blog/linux-and-open-source/chroot-users-with-openssh-an-easier-way-to-confine-users-to-their-home-directories/

【讨论】:

    猜你喜欢
    • 2015-11-22
    • 2011-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-28
    相关资源
    最近更新 更多