180 likes | 412 Views
Chapter 9 Managing Users. Linux users. There are three types of users in linux System users: ? Super user: ? Normal users: ?. Linux users. There are three types of users in linux System users: (they are the software/applications users created
E N D
Linux users There are three types of users in linux • System users: ? • Super user: ? • Normal users: ?
Linux users There are three types of users in linux • System users: (they are the software/applications users created automatically by the system)e.g mail , MySQL , ftp ….. • Super user: ? • Normal users: ?
Linux users There are three types of users in linux • System users: (they are the software/applications users created automatically by the system)e.g mail , MySQL , ftp ….. • Super user: (the superuser/root user/system administrator is only one, his duties are to install software + create or delete users + look after the system resources ….) the prompt sign of super user is # in all shells . • Normal users: ?
Linux users There are three types of users in linux • System users: (they are the software/applications users created automatically by the system)e.g mail , MySQL , ftp ….. • Super user: (the superuser/root user/system administrator is only one, his duties are to install software + create or delete users + look after the system resources ….) the prompt sign of super user is # in all shells . • Normal users: (the normal users can me many , the powers of normal users are limited but normal user has full powers in his home directory ) the prompt sign of normal users in $ in bourne shell and % in c-shell
Linux users The files which keeps the information of users • The passwd file: (etc/passwd) old method file • User name • Password • User id • Group id • User description • User home directory • User shell
Linux users The files which keeps the information of users • The shadow file: (etc/shadow) new method file, most information is encrypted • User name • Password • User id • Group id • User description • User home dir • User shell
Users and Groups Users name + User idbilal + 501humans can memorize + computer can memorize Group name + group idUsman + 502humans can memorize + computer can memorize
File permissions Giving file permissions to files and directories Command -option argument description chmod 777 myfileWill assign read, write and execute permissions to all owner, group and others (rwxrwxrwx) chown -R alimydirIt will change the ownership of the Directory mydir for the user ali, -R option will change ownership of the sub directories residing inside mydir as well. chgrp-R usmanmydirIt will change the group ownership of the directory mydir for the user usman, -R option will change group ownership of the sub directories residing inside mydir as well.
Group Information File The files which keeps the information of group • The group file: (etc/group) • group name • Password • Group id • Assigning password to more then one user chpasswdusername:password chpasswd umar:abc123 usman:ord4446 zahid:sleep7-6 ....:....
Creating and Deleting group Creating a Group • groupaddbilal Removing a Group • groupdelbilal • groupmod(to modify a group) • useradd –G (to create a fresh user and assign him to a group) useradd –G bilalbillygroup You can also create,add and remove groups and users by GUI .
Creating and Removing User Creating a User • useraddbilal Assigning a password to a User • passwdbilal ****** ****** Creating new user and assigning password , shell and id • useraddumar –p abc123 -s /sbin/zsh -u 574 Deleting a user add users home directory as well • userdel –r bilal ‘-r’/home/bilal
Monitoring activities of users • ac • who (will display who are currently logged in and what terminals they are using) Managing Password security • password should be not simple • Password should be not so long • Password should not be written near your pc • Password should not be very difficult • su(will switch to root user, will ask for password before switching ) • subilal(will switch to the user bilal, will ask for bilal password before switching) • suumar(will switch to the user umar, will ask for umar password before switching) Switching users
Granting Root powers to a user on occasion ‘5 minutes default time’ sudo(The user must authenticate himself with the password , list of authorized users is in /etc/sudoers and super user can only access) • First you need to add the user in the file sudoers and assign a password • sudofdisk –l /dev/hda1 (After this the system will ask you for the password, and will match it in the /etc/sudoers/ file) The above command is a system administrator level Command but a normal user will execute it ‘system Disk checking’. Taking back Root powers from a user bash –r (First shift to that user account and type the command)
Users Login Process • Login prompts. • If the user is not root and tries to type wrong password of root then the system will halt and a warning message is issued. • A file /etc/shadow is examined to see if any restrictions are on this particular user. • Password prompts. • User id and Group id being used are set on terminal. • Terminal environment is set. • The home, mail, shell, log is preserved. • The default path of user are set, e.g mail, home etc… • If there are any greeting messages then they are set. • Lastly the user command shell starts.
Disk Quotas • This can be set to both a user and a group . • Quota management is not enabled by default and has to be enabled and configured manually. • Through the vi editor change the file /etc/fstab and set the rules. Gui control panel