0

I just created a new user on my server, but I only want this user to have access to var/www/ and all the files/folders inside that.

They should be able to access no other files on the server except those.

How would I do this?

Thanks!

4
  • Try to chroot that user to that directory. I can't give examples right now, but restricting to one directory does call for chroot.
    – DaDaDom
    Apr 28 '10 at 12:23
  • @DaDaDom if you do that, the user won't be able to execute anything, as there would be no /usr/bin, etc.
    – chmeee
    Apr 28 '10 at 12:51
  • @Michael why don't you tell us why you wan't to do that?
    – chmeee
    Apr 28 '10 at 12:52
  • well, I made a new user so the user can access the server via SFTP. I don't want him having access to the entire server, just var/www/.
    – Michael
    Apr 28 '10 at 12:59
4

The recommended way to do this is with SSH's recently added ChrootDirectory feature:

http://www.debian-administration.org/articles/590

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy