SYS255 Lab 4.2 - Robertsegee/TechJournals GitHub Wiki
9/28/20 Lab 4 Linux File Permissions: In this lab, we worked with setting file permissions for files, configuring groups and users with their permissions, and directory creation. To start off, creating groups and users. To create a user you use the useradd command and for groups, you use the groupadd command. Once you create a user always set a password on it before continuing to work ahead. To add users to a group you use the command, usermod -aG groupname username. After we did this we created a directory for that group using the mkdir command. To impersonate an account from root use the command, su - username. To create a text file in the directory, simply do echo filename.txt. If you want to overwrite it use echo "whatever you want to put in it" > filename.txt. However, if you want to add onto it then replace > with >>. To change which group has access to a directory use the command chgrp groupname /directoryname/. To adjust the read write and execute permissions on a file, use chmod u for user, g for group, or o for other to determine who you are editing. Then follow it with either + or - depending on which permissions you are granting or taking away. Then follow it with w for write, r for read, or x for execute. So for example if I wanted to add write permissions for a group then it would be chmod g+w /directoryname/. To edit all permissions for files in a directory, use * after the g+w(or whatever you put) to edit all files in the directory.