0

File structure:

enter image description here

I have a VPS running Debian OS and would like to create user accounts on it.

I want it so that when the user logs in with FTP, everything in var appears to be their home directory and they cannot cd out of it.

For example, when user3 logs in, they have access to everything in var (read, write, execute) but cannot view (cd) user1 or user2's personal stuff.

How would I go about doing this?

I think I have to do this in chroot, but I have no idea how this would work.

5
  • This depends on the FTP software you choose. ProFTPd, Pure-Ftpd, vsftpd, etc.
    – user1931
    Feb 25, 2011 at 1:44
  • Well, the ftp software I'll have my clients connect to is FileZilla, but don't I set this in Putty?
    – dukevin
    Feb 25, 2011 at 2:06
  • Yeah are you sure I can make user accounts via ftp? pretty sure you can't
    – dukevin
    Feb 25, 2011 at 3:33
  • Do you want the same username to have a different home directory if they login via shell versus login via ftp?
    – mpez0
    Feb 25, 2011 at 13:23
  • I don't really care as long as they are jailed in sFtp, but it would be nice if they were the same
    – dukevin
    Feb 25, 2011 at 13:34

1 Answer 1

1

This can be done simply by creating a new user-account for every user with 'adduser' and changing the home (-b default_home) to your servers dir. [to add a password use passwd]

Then install ProFTPd, and set it to work on Defaultroot ~ That should be all.

You should check this link out: http://ubuntuforums.org/showthread.php?t=79588

4
  • Thanks. I created a new user with adduser and it put it in the /home directory. I then cd into /home/demo and typed 'home -b default_home' and it said, command home not found.
    – dukevin
    Feb 25, 2011 at 4:25
  • I think I did this wrong, this time I tried useradd -d /home/duke/aa/servers/demo -g users -p demo with password demo, but I still don't know where to set user name.. Can you please spell it out for me, I'm really dumb
    – dukevin
    Feb 25, 2011 at 4:40
  • do i need to create a new group and put all the users into this group?
    – dukevin
    Feb 25, 2011 at 4:54
  • ok so i got useradd -d /home/duke/aa/servers/demo/var/ -g users demo to create the username demo but how do I assign r/w/e permissions and deny them from going up a dir into other people's stuff
    – dukevin
    Feb 25, 2011 at 9:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .