Two (or more) FTP Users have read and write to same directory

7 posts / 0 new
Last post
#1 Fri, 08/01/2014 - 16:25
ReArmedHalo

Two (or more) FTP Users have read and write to same directory

Hello,

If there is another forum topic that covers this please link me and ignore me :)

Anyways, my current setup is I have a virtual server (sub-server to be specific) with a directory of /home/domain.com/domains/sub.domain.com/public_html my main virtual servers login (username: domain) can login of course and read and write to the public_html folder. What I would like to do is create a second FTP user that can read and write to to that same public_html folder.

More details: I'm running TechnicSolder (Minecraft Modpack management platform for the Technic Platform) and I want to allow myself to have one username (the top level virtual server username) and I want to also let my friend upload files to the repository as well.

What I tried: created a new user with email + ftp, set his home directory to /home/domain.com/domains/solder.domain.com/public_html/public/mods (mods folder is the folder I really want shared). After creating his user, I was able to chmod 0775 (from 0755) the mods folder so that the user group had write access. This works until he or I create a sub folder in which case the new folder is 0755 again. I don't really consider it an option to have us chmod every folder and file appropriately.

Is there an easier way to accomplish this?

Thanks :)

Sat, 08/02/2014 - 04:49
Locutus

I see two (untested) things you can try:

  1. Go to "Webmin -> Servers -> ProFTPD Server -> Default server" and create a new "Per-directory options for Directory path". There go to "Files and directories" and change the "New file/directory umask" to "002". It then depends on the permissions the FTP client wants to set when creating new files/directories. The umask, when it is 002, will no longer force group-writable to be off (which the default 022 does).

  2. Create the user as a "Website FTP access user" in Virtualmin instead of a regular user. They will then share the user ID of the main user and have the same access. You can then limit them to the mod directory by setting that as their home directory and configuring ProFTPD to lock users in their home directories.

Sat, 08/02/2014 - 10:41 (Reply to #2)
ReArmedHalo

Thanks for the response!

I'll give option 1 a try. But could you explain how to do option 2? I thought that was what I was doing (creating a website FTP user)?

Thanks.

Sat, 08/02/2014 - 13:03
Locutus

Oh okay, I figured when you said you created "a user with email and FTP" that you created a regular one and changed their login shell.

Are you sure you used the link "Add a website FTP access user" in the edit user screen? Because that function should (and does for me) create a user that has the same user ID as the virtual server owner user. Thus they should be treated as the same Linux user in terms of permissions. You should not need to make files/directories group-writable then.

You can verify this by looking at the user name in the Edit Users screen. "Website FTP access" users have their user name underlined.

Mon, 08/04/2014 - 11:16 (Reply to #4)
ReArmedHalo

What I've done:

1) Select Virtual server from drop down menu 2) Select "Edit Users" beneath that 3) Click the link "Add a user to this server." 4) Filled out username and other information, taking care to select "Email and FTP" from the "Login permissions" dropdown

I do use an LDAP server to store users, not sure if this effects anything.

I just checked, via LDAP Users and Groups, my username has an ID of "1008" while the additional user I created has an ID of "1016".

(Not sure if this matters, but I am logged in to Virtualmin as the Master Admin (root) account)

Mon, 08/04/2014 - 11:36
Locutus

Okay, as I said, when you use the "Add website FTP access user" instead of "Add a user to this server", the user will end up with the same UID as the main user, thus having the same access rights.

Mon, 08/04/2014 - 14:46 (Reply to #6)
ReArmedHalo

I can't seem to locate "Add website FTP access user"... I am visually impaired so sorry if it is right in front of me. Could you describe where this option is please? Thank you :)

[bold]EDIT:[/bold] Found it... I feel dumb :P

Thank you so much! It now is working exactly how I wanted it. I enabled FTP Directory restrictions (apparently I didn't have that on already... oops) and everything is working perfectly so far!

Thanks again!

Topic locked