Upload
odessa
View
91
Download
0
Tags:
Embed Size (px)
DESCRIPTION
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 - PowerPoint PPT Presentation
Citation preview
Chapter 9Managing 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
Linux users
Users name + User id bilal + 501humans can memorize + computer can memorize
Group name + group id bilal + 501humans can memorize + computer can memorize
Users and Groups
File permissions
chmod 777 myfile Will assign read, write and execute permissions to all owner, group and others (rwxrwxrwx) chown -R ali mydir It 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 usman mydir It 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.
File permissions Giving file permissions to files and directories
Command -option argument description
Group Information FileThe files which keeps the information of group The group file: (etc/group) • group name• Password• Group id
Assigning password to more then one userchpasswd username:password
chpasswd umar:abc123 usman:ord4446 zahid:sleep7-6 ....:....
Creating a Group groupadd bilal
Removing a Group groupdel bilal
groupmod (to modify a group) useradd –G (to create a fresh user and assign him to a group) useradd –G bilal billygroup
Creating and Deleting group
You can also create,add and remove groups and users by GUI .
Creating a User useradd bilal
Assigning a password to a User passwd bilal
************Creating new user and assigning password , shell and
id useradd umar –p abc123 -s /sbin/zsh -u 574 Deleting a user add users home directory as well userdel –r bilal
‘-r’ /home/bilal
Creating and Removing User
ac who (will display who are currently logged in and what terminals they are using)
Monitoring activities of users
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 ) su bilal (will switch to the user bilal, will ask for bilal password before switching) su umar (will switch to the user umar, will ask for umar password before switching)
Switching users
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
sudo fdisk –l /dev/hda1 (After this the system will ask you for the password, and will match it in the /etc/sudoers/ file)
Granting Root powers to a user on occasion ‘5 minutes default time’
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)
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.
Users Login Process
1. This can be set to both a user and a group .2. Quota management is not enabled by default and has to be enabled and configured manually.3. Through the vi editor change the file /etc/fstab and set the rules.
Disk Quotas
Gui control panel