CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.

Slides:



Advertisements
Similar presentations
Unit 5 – User Administration Randy Marchany VA Tech Computing Center.
Advertisements

Linux Users and Groups Management
Basic Unix system administration
Race Condition Zutao Zhu 10/09/09. Outline Race Condition –Some functions –File format of /etc/passwd and /etc/shadow –Input Redirection Format-string.
User Account Management WeeSan Lee. Roadmap Add An Account Delete An Account /etc/{passwd,shadow} /etc/group How To Disable An Account? Root Account Q&A.
User Accounts and Permissions Chapter IV / Part II.
Linux+ Guide to Linux Certification, Second Edition
Linux System Administration LINUX SYSTEM ADMINISTRATION.
Configuring Disk Quotas Linux System Administration To implement disk quotas, use the following steps: Enable quotas per file system by modifying /etc/fstab.
Linux Filesystem Management
Introduction to Linux Installing Linux User accounts and management Linux’s file system.
Hands-On Microsoft Windows Server 2008
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
Managing User Accounts. Module 2 – Creating and Managing Users ♦ Overview ► One should log into a Linux system with a valid user name and password granted.
Adding New Users User as an entity - username(UID), GID. UID - typically a number for system to identify the user. GID – a number that recognizes a set.
IT2204: Systems Administration I 1 6b). Introduction to Linux.
Unix System Administration Chapter 6 Adding New Users.
Chapter 6: Linux Filesystem Administration
Module 4 - File Security. Security Overview File Ownership Access to Files and Dircetories Changing File and Directory Ownership Changing File and Directory.
Linux+ Guide to Linux Certification, Third Edition
Managing Users Objectives Contents Practicals Summary
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
ITI-481: Unix Administration Meeting 3 Christopher Uriarte, Instructor Rutgers University Center for Applied Computing Technologies.
The Linux Operating System Lecture 3: Becoming the Superuser and Users and Groups The Tonga Institute of Higher Education.
Users Greg Porter V1.0, 26 Jan 09. What is a user? Users “own” files and directories Permission based on “ownership” Every user has a User ID (UID) 
There are three types of users in linux  System users: ?  Super user: ?  Normal users: ?
Managing Users  Each system has two kinds of users:  Superuser (root)  Regular user  Each user has his own username, password, and permissions that.
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 9: Basic Linux Administration Chapter 11: System Administration: Core Concepts Chapter 16:
Creating and Managing File Systems. Module 5 – Creating and Managing File Systems ♦ Overview This module deals with the structure of the file system,
Introduction to System Admin Sirak Kaewjamnong. 2 The system administration’s job  Adding a new user  Doing backup and restoring files from backups.
Managing Users Objectives –to be able to add, modify and remove Unix user accounts Contents –requirements for a user account –configuration files (passwd,
Fall 2011 Nassau Community College ITE153 – Operating Systems Session 21 Administering User Accounts and Groups 1.
The Saigon CTT Chapter 10 Managing Users. The Saigon CTT  Objectives  Define the requirements for user accounts  Explain group and group accounts 
Manually Creating a New User Account Presented by Carl South.
© 2006 ITT Educational Services Inc. Linux Operating System :: Unit 3 :: Slide 1 Downloading and Installing Software yum pirut Bit Torrent rmp.
ITI-481: Unix Administration Meeting 3 Christopher Uriarte, Instructor Rutgers University Center for Applied Computing Technologies.
CSCI 330 UNIX and Network Programming Unit XX: Linux Administration.
SCSC 455 Computer Security Chapter 3 User Security.
Lecture – Users and groups
Working with users and Groups. 1. Manage users and group 2. Manage ownership, permissions, and quotas.
Linux Use the Command-Line Interface to Administer the System.
SUSE Linux Enterprise Desktop Administration Chapter 9 Manage Users, Groups, and Permissions.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
Chapter 6 Adding New Users. Computer Center, CS, NCTU 2 Steps to add a new user 1.Edit the password and group files >vipw, pw 2.Set an initial password.
Managing Users CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
Experiment No 4 Prepared by, Mr. Satish Pise. Objectives View the /etc/passwd file and describe its syntax. View the /etc/shadow file and describe its.
This slide deck is for LPI Academy instructors to use for lectures for LPI Academy courses. ©Copyright Network Development Group Module 14 Managing.
Linux Filesystem Administration
LINUX SYSTEM ADMINISTRATION
Configuring Disk Quotas
System Programming and administration CS 308
Basic Commands ls cp ls –l (in detail format) echo ls –a
Chapter 11: Managing Users
Advanced Operating Systems
Ubuntu Working in Terminal
Chapter 2 User Management
Linux Users and Groups Management
Adding New Users, Storage, File System
IS3440 Linux Security Unit 4 Securing the Linux Filesystem
LINUX SYSTEM ADMINISTRATION
System & Network Administration (MCSA & RHCSA)
COP 4343 Unix System Administration
Module 13 System and User Security
Adding New Users Chapter 6.
Administering Users and Groups
Linux Filesystem Management
Administering Users and Groups
Adding New Users.
Configuring Disk Quotas
Presentation transcript:

CSC414 “Introduction to UNIX/ Linux” Lecture 6

Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage Structure. 4. Processes and Inter- Process Communication. 5. Shell Programming. 6. User Management and Disk Quota. 7. System Management. 8. Network Management. 9. Security. 10. Advanced System Administration. 2015Qassim University, College of Computer, 9th level 2

Contents: User/ Group Management. Create, manage, suspend and delete users. Disk Quota. Concepts and factors. Enabling, creating and managing disk quota. 2015Qassim University, College of Computer, 9th level 3

Creating a new User Account Add an entry in /etc/passwd and /etc/shadow file (use next uid and suitable gid). You will have to create the user directory and assign a password to the user. Use useradd or adduser command to create a new user (useradd –g -d -c -s login-name) and groupadd to create a new group (groupadd group-name). You will have to assign a password (passwd login-name) In GUI: Applications  System Settings  Users and Groups 2015Qassim University, College of Computer, 9th level 4

User Management Commands su Single user login. (su -) useradd Create a new user or update default new user information. (useradd –g -s -c –d userdel Delete a user account and related files. (userdel ) usermod Modify a user account. users Print the user names of users currently logged in. wall Send a message to everybody's terminal. (wall “text message”) who Display the users logged in. whoami Print effective user id. passwd Set a user's pass word. (passwd, passwd ) 2015Qassim University, College of Computer, 9th level 5

6 2015Qassim University, College of Computer, 9th level

2015Qassim University, College of Computer, 9th level 7 The /etc/passwd file is a list of users recognized by the system. It can be extended or replaced by a directory service, so it’s complete and authoritative only on standalone systems. The system consults /etc/passwd at login time to determine a user’s UID and home directory, among other things. Each line in the file represents one user and contains seven fields separated by colons. /etc/passwd File

/etc/passwd Holds user account info Included fields are: Login name User Id (uid) Group Id (gid) General Comment about the user Home Directory Shell 2015Qassim University, College of Computer, 9th level 8

Contd Encrypted passwords used to live in the second field, but that is no longer safe; with fast hardware, they can be cracked (decrypted) in minutes The passwd file contains an x in the encrypted password field on Linux, Solaris, and HP-UX and an ! or a * on AIX. The actual encrypted passwords are stored in /etc/shadow on Linux, Solaris, and HP-UX and in/etc/security/passwd on AIX. 2015Qassim University, College of Computer, 9th level 9

/etc/shadow File /etc/shadow Contains the encrypted password information for users' accounts and optionally the password aging information. Included fields are: Login name Encrypted password Days since Jan 1, 1970 that password was last changed Days before password may not be changed Days after which password must be changed Days before password is to expire that user is warned Days after password expires that account is disabled Days since Jan 1, 1970 that account is disabled 2015Qassim University, College of Computer, 9th level 10

Suspending a User Account Put a * as start of Password field in /etc/shadow Change login shell to /sbin/nologin Use GUI to suspend the user 2015Qassim University, College of Computer, 9th level 11

Removing a User Account Remove login id from /etc/passwd & /etc/shadow file and delete home directory userdel –r Use GUI to Delete the user 2015Qassim University, College of Computer, 9th level 12

What is quota? Linux file systems implement the disk quota mechanism. Users can be allocated disk quotas on specific file systems and can be restricted by number of disk blocks and/or number of inodes. Disk space can be restricted by implementing disk quotas which alert a system administrator before a user consumes too much disk space or a partition becomes full. On Linux, you can setup disk quota using one of the following methods: File system base disk quota allocation User or group based disk quota allocation

contd. On the user or group based quota, following are three important factors to consider: Hard limit – For example, if you specify 2GB as hard limit, user will not be able to create new files after 2GB Soft limit – For example, if you specify 1GB as soft limit, user will get a warning message “disk quota exceeded”, once they reach 1GB limit. But, they’ll still be able to create new files until they reach the hard limit Grace Period – For example, if you specify 10 days as a grace period, after user reach their soft limit, they would be allowed additional 10 days to create new files. In that time period, they should try to get back to the quota limit.

Configuring Disk Quotas The quota RPM must be installed to implement disk quotas. To implement disk quotas, use the following steps: 1. Enable quotas per file system by modifying the /etc/fstab file. 2. Remount the file system(s). 3. Create the quota database files and generate the disk usage table. 4. Assign quota policies.

Enabling Quotas As root, using a text editor, edit the /etc/fstab file. Add the usrquota and/or grpquota options to the file systems that require quotas. Remounting the File Systems: mount -o remount file-system

Creating the Quota Database Files After each quota-enabled file system is remounted run the quotacheck command. The quotacheck command examines quota-enabled file systems and builds a table of the current disk usage per file system. The table is then used to update the operating system's copy of disk usage. In addition, the file system's disk quota files are updated. To create the quota files (aquota.user and aquota.group) on the file system, use the -c option of the quotacheck command. quotacheck -cug /home

contd. After the files are created, run the following command to generate the table of current disk usage per file system with quotas enabled: # quotacheck -avug The options used are as follows: a Check all quota-enabled, locally-mounted file systems v Display verbose status information as the quota check proceeds u Check user disk quota information g Check group disk quota information

Assigning Quotas per User The last step is assigning the disk quotas with the edquota command. To configure the quota for a user, as root in a shell prompt, execute the command: # edquota username Perform this step for each user who needs a quota.

Assigning Quotas per Group to set a group quota for the devel group use the command: # edquota -g devel To verify that the group quota has been set, use the command: # quota -g devel Setting the Grace Period for Soft Limits If a given quota has soft limits, you can edit the grace period (i.e. the amount of time a soft limit can be exceeded) with the following command: # edquota -t

Report the disk quota usage for users and group Use the repquota command as shown below to report the disk quota usage for the users and groups. # repquota /home *** Report for user quotas on device /dev/sda3 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace root nobody ramesh john

Contd For each file system where a quota has been defined, the current user will receive a line of output with the following fields: Filesystem Mount point of the file system with quotas Usage Amount of blocks used Quota Number of blocks allowed (soft) Limit Blocks allowed (hard) Grace Applicable only if over quota Files Current number of files used Quota Number of blocks allowed (soft) Limit Blocks allowed (hard) Grace Applicable only if over quota Qassim University, College of Computer, 9th level

Reading Chapter 6 from the textbook. Quota HOWTO from tldp site Qassim University, College of Computer, 9th level 23