Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I would like to give someone access to upload/modify/delete files and directories in one specific directory. I don't know what type of PC they have, but it is probably a Mac or PC. What would be the best way to do so? FTP or Samba or something else? Thanks
Easiest way is to setup an ftp server like pure-ftpd I guess but this is not very secure. Another option is to run an ssh server and give access via scp or ssh. But I do not know how to restrict users in this case to a specific directory. Should be possible though.
...in other words, before you can do that, you have to set up some kind of server on your computer.
do you have that already? then it's easy and there's various ways.
it doesn't matter what kind of OS the remote client uses, but for them it would probably be more convenient if it's a unix-like system (like e.g. linux).
It is the restricting to a directory part which has me for a loop.
I could do this using Samba, but I don't think Samba is the best approach, and feel sftp seems best. I have ssh running on the server, and can access it using Filezilla FTP client.
When remotely accessing, I just want them to have access to one particular directory, and ideally see just that directory when they sftp in.
Thanks J-Ray, Looks promising. Seems like I can add a user, make his home directory the specific directory I wish to share, and all (hopefully) will work.
Took me a while to get back to this. I did not give you all the requirements, and unfortunately this will not work. To chroot a user or group, root needs to exclusively own directories under the directory you are trying to jail them to. I need others to be able to access the directory. If I add a group to the directory structure and give it 0775 permission, I get a "Write failed: Broken pipe" error when trying to sftp in.
Now, jailing the user to their home directory, and not some other directory, showed some success. Problem with this approach is I am trying to jail them to specific subdirectory in my website directory root. It is "possible" to move part of my website to the jailed user's home, and then mount their home back into my website file structure. This is not ideal, however, since I am using Git for version control on my website files.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.