Results 1 to 2 of 2
I am trying to setup 2 individual FTP users. They should both have access to the same directory. They both need to be able to read/write into the directory. But, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-30-2011 #1
- Join Date
- Mar 2011
Shared FTP directory - separate user permissions
I am trying to setup 2 individual FTP users. They should both have access to the same directory. They both need to be able to read/write into the directory. But, I want them not to be able to write to each other's files (e.g. delete, remove, rename, etc.).
So let's say the shared directory is: /home/ftp/shared/
UserA needs read/write access to /home/ftp/shared/. UserA should only have write access to his own files.
UserB also needs read/write access to /home/ftp/shared/. UserB should only have write access to his own files.
It would be a unix box of sorts, but that is the only restriction. I could use whatever software. I am currently thinking pure-ftpd or vsftp but I am open to all ideas.
Any ideas how I can accomplish this?
- 03-31-2011 #2
Hey, jon20usa. Welcome to the forums.
This shouldn't be too difficult for you to setup. I just created a very similar setup in RedHat. We can do this all from a terminal, so pop open your favorite shell and let's begin.
First we want to create a group that these two users can be a part of so they can both access the FTP share. We'll call it 'ftpusers' in this example, but you may call it what you wish:
useradd -m -G ftpusers -d /home/ftp -s /bin/bash user1 && passwd user1 useradd -m -G ftpusers -d /home/ftp -s /bin/bash user2 && passwd user2
mkdir -p /home/ftp/shared
chown root:ftpusers /home/ftp/shared
chmod 770 /home/ftp/shared
Once you have your FTP server installed (I use vsftpd and love it), you can go ahead and try to log into it using the new users. They should be dropped into their home directory '/home/ftp' and access the 'shared' directory.
There are many other ways of configuring this, and the above is really to help you get an idea on how it could work. If you need help, I'll do what I can to assist.
Last edited by Nagarjuna; 03-31-2011 at 01:45 AM.