0

I have created a user brandon. I am trying to keep brandon in his home directory (/home/brandon/), I would like him to be able to edit/delete/create folder and files, but I don't want him to go to /home/ or anything else above his directory.

I have Webmin/Virtualmin, but I still cannot figure it out. Can anyone explain to me any configs I need to edit or someway I can do it with Webmin?

techraf
  • 3,316
  • Will brandon log into the machine (i.e. get a shell), or are you worried about ftp access or similar? – noleti Jul 26 '14 at 05:48

1 Answers1

0

Don't do it because there are some important files like /bin, /etc, /var which are necessary for normal users.

If you still want to, you just have to work a little bit with permissions.

Suppose you have the following users of your machine:

  • carla - the owner of her home directory
  • lisa - the owner of her home directory
  • root - the superuser

Now the most important thing is, change the permissions.

First open terminal:

sudo -s

chmod 700 /home/user

It will give no permission to other users on your home directory (/etc, /bin, etc.) and that is what you were asking for.

Because by default it is 755.

Type umask 077 (without sudo helpful in your case)

This will give future files or directories 700 permission.

If you want to check it is working, check through terminal. Don't do it through GUI desktop.

techraf
  • 3,316
  • don't do that if you want those users to ever log into your machine. Users need to be able to see contents such as /bin to execute anything. There is a reason why 755 is default. – noleti Jul 26 '14 at 05:44
  • I am using this for my friend, he is going to run a minecraft server with FTP/puTTy, he just needs to be able to put his files in, and start his server (eventually Multicraft, but I want to figure this out instead) – user309285 Jul 26 '14 at 05:49
  • 1
    @user309285 You can remove read rights to /home/YOURUSER if you want, but your friend will need read rights to /bin and similar to start java for the minecraft server. – noleti Jul 26 '14 at 05:54
  • Not sure what happened, I didn't even get to what you said. I looked at his user in webmin and then I lost connection to the server with puTTy. I also can't connect to the FTP with any user excluding his user. Any solutions? – user309285 Jul 27 '14 at 05:16