how to dump all users to the same sftp starting directory?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
how to dump all users to the same sftp starting directory?
Hello,
Using CentOS 5.5. I have a handful of users that I need to have connect to my server via sftp and start in the same directory.
for example, user1, user2, user3, etc.. will connect via sftp and upon connection will all be in the /some/dir/path/ftp-root directory.
I know one way is to create these users all with the same 'home' directory, since by default a user starts in their home directory when connecting via sftp, but before just doing that, I wanted to find out if that is really the appropriate method to use? alternatives? Is there some setting on the sftp server end that could direct all users to one starting directory so that these users don't have to have the same 'home' dir? I'm using the sshd daemon that comes with CentOS 5.5 (with all current updates/patches).
no one? I didn't specify it was the openssh sftp-server module in use, but I assumed that would be implied by specifying I was using sshd. I think I'm going to create users with their own home directories and just put a link to what I essentially want to be the ftp root directory, that way they just have to navigate one level to get to where they should be. Creating several users all with the same home directory just smelled like trouble, not sure why because I'm not that experienced with linux, but that's why I posted here, hoping for some guidance. I was also considering changing the server side of my equation to use something else, like vsftpd, which may have more options for what I need, but another requirement I have is radius auth, which I already have working with my sshd/sftp-server setup, so I don't want to have to redo that with another server if I don't have to.
anyone? any answers to my original post/questions? how about my current plan (keeping separate home directories and just placing a link to the ftp root)?
Depends exactly what you want. If the users only logon to upload/download to/from a common dir, just make one dir.
If you want/need separate home dirs for other reasons eg ssh access, then create all users in 1 group, but set home dirs to 700 perms and create a group owned/shared dir for ftp sharing eg 770 perms.
thanks for the responses, it's appreciated. I'm not looking to restrict each user to their own home directory.
- I was looking to have *all* the users start in the same directory upon connecting to sftp. Like /foo/bar/ftproot. But the only way I could think of was by making all the users' home directories actually be /foo/bar/ftproot, and I don't know if having multiple users have the same home directory is a bad thing. In this case, these users only exist for the purpose of read/write sftp access into this /foo/bar/ftproot directory (and subdirectories), no shell access is required.
- having all files and directories created under /foo/bar/ftproot default to group owned is also desired... should I do that the way suggested already here, or should I use an sftp-server option? I think there was a umask option which sounded like it would take care of that also? or maybe that was only for the case of anonymous access?
- my 'plan B', because I am not sure about how to go about plan A, was to go ahead with each user having their own home directory and simply placing a link to /foo/bar/ftproot in each home directory. Not ideal due to having to navigate another layer down to get to what should really already be the 'starting point', but it would work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.