1

I have a thing I want to do. I have set up a VSFTP server, and put its users in "jail", so they cannot look anywhere else except for their home directory.

However, now I want to do something more. I want to find a way to create a shared folder among these users, so that everyone of them can read and write in it. But I haven't done so yet. My first idea was to create an external folder, give it the right permissions, and create a link in each home folder, so that they can access it, but it does not work (users still can't access it due to being jailed). Any ideas? Of course the users should not be able look "up" from the shared folder, just like their home directories.

Noob Doob
  • 435
  • 1
  • 8
  • 22

1 Answers1

1

You may use a bind mount(8):

mount -o bind /tmp/ftpshare /ftp/jail/user1/share

as solution.

dawud
  • 1,450
  • 12
  • 18
MolbOrg
  • 212
  • 2
  • 9
  • @dawud Is this the only thing I got to do? I created an empty folder in the user directory, and after I executed the command, I get this error:mount: /tmp/ftpshare is not a block device. (Of course I used the respective folder paths of my system). – Noob Doob Apr 05 '14 at 11:48
  • you have to use *bind* option, it tells mount command to use source as a directory, not as an block device. Both source and destination directory must exists. Destination directory will have same user:group and permissions as source, also if u change some of them on source directory - it will change also on destination too. You may count that like directory hard link. – MolbOrg Apr 05 '14 at 12:00
  • @dawud i must use "bind" and NOT "--bind"? Perhaps it was my bad all along :P – Noob Doob Apr 05 '14 at 12:06
  • you must use mount command in form it written: **mount -o bind /source /destination** . as NB u may use it multiple times with same source and different destinations. – MolbOrg Apr 05 '14 at 12:16