0

I am working on a project in which a junior developer needs to FTP files onto the server and work in two separate directories that are at the same level on the server. Is is possible to assign BOTH the directories as home directories so when he logs in using FileZilla he sees both the directories listed?

So far I have not found a satisfactory answer anywhere. I am using this command:

useradd -d /path/to/homedir -s /sbin/nologin username

Where /sbin/nologin is a dummy shell I created because user is only allowed to login via FTP and has no shell access.

Nikster2014
  • 101
  • 1
  • On unix a user can only have a single home directory. – Gerald Schneider Jul 22 '20 at 06:44
  • Is it possible to create a directory that "points" to the two directories and if assigned as a home directory, would "contain" the two directories as subdirectories? I am making this up...but hoping it may be possible!! – Nikster2014 Jul 22 '20 at 06:50
  • Well ... yeah. Create a directory and put both directories inside it. Depending on your FTP server and its configuration it could also be possible to use symlinks instead (if the user is not chrooted). – Gerald Schneider Jul 22 '20 at 07:18
  • I would do that except that there are other directories at the same level to which the user should not have access to. – Nikster2014 Jul 22 '20 at 07:29
  • Use Linux permissions/ACLs to restrict access to those directories. – Tero Kilkanen Jul 22 '20 at 07:39

1 Answers1

1

Add the user to an appropriate group. Modify file permissions or ACLs such that this group has access to only the files in question.

Move the files to a directory with nothing else irrelevant in it. Not strictly necessary with suitable file permissions, which already provide access control.

Set their home to (one) parent directory that contains everything they need. Set ftpd to chroot them into home.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34