How do I allow an ftp user access to 2 directories?
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
What is the reason for using software from the dinosaur ages? Redhat 3 is very old and probably not supported anymore with updates. Mount the directories to empty directories in the ftp user's home directory. Here is an example.
The ftp user's name is john, and you want john to be able to see two directories called foo and bar that are in the root directory.
Code:
mkdir /home/john/foo
mkdir /home/john/bar
# mount -o bind -t ext3 /foo /home/john/foo
# mount -o bind -t ext3 /bar /home/john/bar
Also you should change the permissions of the directories for others. Here is an example.
Code:
# chmod o+rwx foo
Now anyone who is not the owner of foo or in the same group that foo has can read, write and execute foo.
Maybe not in this case but if you want to have better control over file and folder permissions you might want to look at getfacl and setfacl ... so you can add permissions for a user just for a couple of files using "setfacl" rather than adding him to the group itself....
Also get rid of RH 3 ... wait ... you dont mean Red Hat Enterpise Linux 3.0 ... do you?? .. if Yes then its fine...
I do not want to allow any other users the ability to write into this directory and I cannot have the ftp user a member of the group buildeng because buildeng also owns a lot of other directories where the ftp user doesn't need to have access.
I think setfacl has a -R option..recursive...for all the files in the directory....also use the -s option n replace the entire ACL... you'll find alot of examples in the man pages of setfacl at the bottom and on the net if you look just in case you get stuck with the syntax which is slightly complicated...
Post back if problems...I'll reply tomorrow if I can ..its 12:30am here in India
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.