Chapter 1. File security and permissions

To stop unwanted users accessing your files, you can set permission bits on them, and on your directories. You can also specify what type of permissions the files get when they are created: this is just a small part of system security. We will not concern ourselves with the big security picture, just the files and directory part.

This chapter will cover:

  • permissions on files and directories;

  • the setuid;

  • chown and chgrp;

  • umask; and

  • symbolic links.

A file is owned by the user who created it and the group the user belongs to. That user alone can then specify who can read, write and execute that file. Of course, root or the system administrator can override anything that a mere mortal user does. A file when created ...

Get Linux and Unix Shell Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.