Www.mitntraining.com



4910455-3175009525078105mobile itnTSolutions, LLC.00mobile itnTSolutions, LLC.4572002857500Linux Systems AdministratorProgramClass Notes:“Working with Users, Groups, and Permissions”Part VII00Linux Systems AdministratorProgramClass Notes:“Working with Users, Groups, and Permissions”Part VIIWorking with Users, Groups, and Permissions – Part VIISetting Default Permissions with umask:In the previous section, you learned how to work with default ACLsumask is a shell setting that determines the default permissions that you will get if you don't use ACLsIn this section, you will learn how to modify default permissions using umaskwhen creating a new file, some default permissions are setthese permissions are determined by the umask settingthis is a shell setting that is applied to all users when logging in to the systemthe umask setting contains a numeric value that is subtracted from the maximum permissions that can be set automatically to a filemaximum setting for files: 666maximum setting for directories: 777there are some exceptions to this ruleoverview of umask settings in table below:Umask values and their results:of the digits used in the umask, as with the numeric arguments for the chmod command, the first digit refers to end-user permissions, the 2nd digit refers to the group permissions and the last refers to default permissions set for othersthe default umask setting of 022, gives 644 for all new files and 755 for all new directories that are created on your serverThere are 2 ways to change the umask settings:one for all usersone for individual usersIf you want to set umask for all users, you must make sure the umask setting is entered in the configuration file /etc/profileIf the umask is changed in this file, it applies to all users after logging in to your serverAn alternative to setting the umask setting in /etc/profile, where it is applied to all users logging into the system, is to change the umask settings in a file with the name .profile OR .bash_profile OR .bashrc, which is created in the home directory of an individual usersettings applied in these files are for the individual user onlyPersonal environment variables and startup programs should go in ~/.bash_profileSystem wide environment variables and startup programs are in /etc/profilePersonal aliases and functions are in ~/.bashrcAdditional Info:Breakdown: umask u+wumask u-x,g=r,o+wumask a=We covered this, but I wanted to add again, to reinforce:Example 2:Example 3:#umask 022#umaskNow, let's create a new file:#touch testfile2#ls -l testfile*Here are some other example umask commands:#umask a+r#umask a-x#umask u=rw,go=#umask 777#umask 000Working with Attributes:List of the most useful attributes:Example: #chattr +i somefile-- applies the attribute "i" to somefile-- To remove: #chattr -s somefileReal example:# chattr +i myfile (change attribute of file)# lsattr myfile (show attribute of file)# rm myfile (should get an error)Summary for the entire section of this Program:You have learned:How to set up your server with users and groupshow to use permissions and attributes to make sure users ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download