授予FTP用户访问特定目录的权限

时间:2011-07-17 20:23:01

标签: apache ftp ssh

所以我在谷歌周围找到了关于如何创建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目录,按照说明:`/家/域/的public_html /壁纸

如果要更改权限,则应使用二进制选项而不是字母。例如:

chmod 777 - 让所有用户都能做到。尽管你想要的是755,你可能会更好。

1 个答案:

答案 0 :(得分:1)

您可以尝试通过在/home/domain/public_html/wallpapers文件中对其进行修改,将用户主目录更改为/etc/passwd

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