【问题标题】:Give FTP User access to specific directory [closed]授予 FTP 用户访问特定目录的权限 [关闭]
【发布时间】:2011-07-17 20:23:00
【问题描述】:

所以我搜索了一下,找到了有关如何创建 FTP 用户并授予他对目录的访问权限的说明

    To create FTP user through SSH you would need to follow below mentioned steps:

1. Login as root through SSH.

2. Next add the user account you want using the 'useradd' command

useradd <username>

3. Now create a special group for that user.

groupadd <groupname>

4. Now to add the user to the group

gpasswd -a <username> <groupname>

These commands are non-standard but
available on most popular
distributions. If not, then you can
try editing /etc/group using your
favorite text editor.

5. Change the group ownership of the special directory to that group.

chgrp -Ra groupname
/path/to/your/web/directory

6. Enable write permissions

chmod -R g+rw

/path/to/your/web/directory

现在一切都很好,但问题是在 ftp 上,我的用户(名为 jon)按照说明登录到目录 /home/jon 而不是我为他的组设置的 Oxford 目录:`/home/域名/public_html/壁纸

如果您想更改权限,您应该使用二进制选项而不是字母顺序。例如:

chmod 777 - 为所有用户做所有事情。使用 755 可能会更好。

【问题讨论】:

  • 您需要更具体。这是什么操作系统?你在运行什么 FTPd?这完全取决于操作系统和 FTP 服务器。例如,在 ProFTPd 上,您可以为每个用户设置不同的用户目录。
  • apache,centos,我相信我有proftpd

标签: apache ftp ssh


【解决方案1】:

您可以尝试通过在/etc/passwd 文件中编辑用户主目录来将其更改为/home/domain/public_html/wallpapers

但更多信息会很棒。这完全取决于您的操作系统和 ftp 服务器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-10
    • 1970-01-01
    • 1970-01-01
    • 2016-12-20
    • 1970-01-01
    • 1970-01-01
    • 2021-02-28
    相关资源
    最近更新 更多