User Tools

Site Tools


nix:permissions

Permissions

Securing a directory

You're here because you heard that this would a good idea. There are going to be many ways to ensure a directory is 'secure', but that will depend on your requirements.

I will assume that you are the only person that will need access to said directory. I also will not try to explain unix permissions to you. If you want to know more I suggest you read the link at the top of this page. Follow along below to create a directory that only you will be able to access.

Given a directory foo we can do the following:

chown $USER:$USER foo

$USER will translate to your username, but we recommend you actually type out your username. This will set the user and the group to $USER.

Now make sure that only the user field can has access to the directory.

chmod 700 foo

I have a directory structure full of files and I want to ensure no one else can read them

I got your back.

chmod -R go-rwx foo

  -R: recursive. 
  g: select group permission
  o: select other permission
  -: remove
  r: read permission
  w: write permission
  x: execute permission 

We are asking chmod to remove read, write, and execute permissions on the group and other permission fields.

/var/lib/dokuwiki/data/pages/nix/permissions.txt · Last modified: 2017/09/15 17:03 by kauffman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki