给FTP用户访问特定目录 [英] Give FTP User access to specific directory
问题描述
所以我google'd四周,发现关于如何创建一个FTP用户,并给他访问目录这些说明
So I google'd around and found these instructions on how to create an FTP user and give him access to a directory
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,我的用户(名为乔恩)登录到目录 /家庭/乔恩
而不是牛津目录我设置了他的研究小组,按照指示:`/家庭/域/的public_html /壁纸
Now that was great and all, but the problem is that on ftp, my user (named jon) logs into the directory /home/jon
instead of the Oxford directory I set for his group, as per instructions: `/home/domain/public_html/wallpaper
如果要更改权限,你应该使用二进制选项,而不是按字母顺序排列。例如:
If you want to change the permissions you should use the binary option rather than alphabetical. For example:
搭配chmod 777 - 为所有用户做所有。你可能会用更好的755虽与你想要的东西。
chmod 777 - for all users to do all. You would probably be better with 755 though with what you want.
推荐答案
您可以尝试改变用户的主目录 /家庭/域/的public_html /壁纸
通过编辑它在 / etc / passwd文件
文件。
You could try to change the users home directory to /home/domain/public_html/wallpapers
by editing it in the /etc/passwd
file.
但更多的信息,将是巨大的。这一切都取决于你的操作系统和FTP服务器上。
But more information would be great. It all depends on your operating system and the ftp server.
这篇关于给FTP用户访问特定目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!