File Permissions in Linux - jwells24/Tech-Journal GitHub Wiki

Linux File Permissions

  • When working with permissions, first us the sudo -i command to change into the root user. This will allow uss to add users and change permissions with root access. First, to add users, use the command: useradd bill. Next, set bill's password with: passwd bill. To create a group for bill, use the command: groupadd group1.

  • Now, we want to add bill to the group. Use the command: usermod -aG group1 bill. When changing the permissions on any file or directory, we want to use the command: chown, chusr, or chgrp. These 3 commands will individually change the owner, user, or group of a file or directory.

  • To change permissions on a file or directory, use the command: chmod x*___ group1. The x can be replaced with g or o, to change the group or other permissions. The * is replaced by a plus or minus sign to signal the deleting or adding of permissions. The underscores will be replaced with r, w , or x to represent the permissions to read, write, or execute on a file or directory.