6. Adding New Users Xiang Sha Cmsc 691x. 6.1 The /etc/passwd File The /etc/passwd File is a list of users recognized by the system. Login name Encrypted.

Slides:



Advertisements
Similar presentations
University of Pisa Computer Science Department System Administration adduser Stefano Bistarelli University of Pisa Computer Science Department
Advertisements

Unit 5 – User Administration Randy Marchany VA Tech Computing Center.
Linux Users and Groups Management
Unix/Linux basics user management Operating systems lab Gergely Windisch room 4.12
Basic Unix system administration
Pre-Assessment Questions
1 Introduction to UNIX Ke Liu
Adding New users This is a routine chore on most systems
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.
Lesson 22 – Introduction to Linux Systems Administration.
Chapter 6 Adding New Users. Computer Center, CS, NCTU 2 Steps to add a new user 1.Edit the password and group files >vipw 2.Set an initial password >passwd.
Linux+ Guide to Linux Certification, Second Edition
Linux System Administration LINUX SYSTEM ADMINISTRATION.
1. This presentation covers :  User Interface Administration  Files System and Services Management 2.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
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.
2/19/2003 Lecture 3 Computer System Administration Lecture 3 Setup (continued)
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.
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
CIT 470: Advanced Network and System AdministrationSlide #1 CIT 470: Advanced Network and System Administration Accounts and Namespaces.
Managing Users Objectives Contents Practicals Summary
ITI-481: Unix Administration Meeting 3 Christopher Uriarte, Instructor Rutgers University Center for Applied Computing Technologies.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
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.
ITR3 lecture 6: intoduction to UNIX Thomas Krichel
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.
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.
User Environments Objectives –to provide appropriate environments for different types of users Contents –different login programs –user profiles –restricted.
Linux Based Networks University of Education Instructor: Muhammad Amer Irshad.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
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.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
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.
1. Edit the password and group files > vipw(8), pw(8) 2. Set an initial password > passwd lwhsu 3. Set quota > edquota [-u] lwhsu 4. Create user home.
CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
SUSE Linux Enterprise Desktop Administration Chapter 9 Manage Users, Groups, and Permissions.
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.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
Managing Users CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
Basic UNIX system administration CS 2204 Class meeting 14 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
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.
Chapter 11: Managing Users
Ubuntu Working in Terminal
Chapter 2 User Management
Linux Users and Groups Management
Adding New Users, Storage, File System
Unix : Introduction and Commands
LINUX SYSTEM ADMINISTRATION
Periodic Processes Chapter 9.
Module 13 System and User Security
Adding New Users Chapter 6.
Administering Users and Groups
Adding New Users.
Chapter 6 Adding New Users
Presentation transcript:

6. Adding New Users Xiang Sha Cmsc 691x

6.1 The /etc/passwd File The /etc/passwd File is a list of users recognized by the system. Login name Encrypted password UID number Default GID number “GECOS” information: full name, extention, home phone Home directory Login shell

A example root: jsg8Y.1p6uWMo: 0 : 0: The system,,x6096, : / : /bin/csh Login name Encrypted password UIDGID “GECOS” information Home directory Login shell * Each line in the file represents one user and contains seven fields separated by colons * Root : x : 0 : 0 : root : /root : /bin/bash shadow

Login name Must be unique. Usually no more than 8 characters long depending on the OS. NIS or NIS+, login names are limited to 8 characters regardless of the OS.

Login name cont. Thumb up rules: Stick to alphanumerics and to limit login names to 8 characters. Case sensitive. Since most mail systems expect login names to be lower case, we suggest avoiding uppercase characters in login names unless the user is not expect to receive any mail. Easy to remember. F_names, l_names, initials, or some combination of these all make reasonable naming schemes.

More than one machine?! Login names should be unique: 1. A user should have the same login name on every machine. 2. A particular login name should always refer to the same person. * Duplicate names can lead to confusion. Users will often send mail to the wrong address.

Edit /etc/passwd Q: How to edit /etc/passwd to create a new account ? ‘*’ in the encrypted passwd field prevents unauthorized use of the account until you have set a real password.

Edit /etc/passwd cont. Big no no Never leave passwd field empty – that introduces a jumbo-sized security hole because no passwd is required to access the account.

Encryption algorithm Standard DES passwords: Unencrypted passwords is limited to 8 characters. Only first 8 chars are significant for long password. Hint: HP-UX : trusted mode- allow and use passwords of and length. Red Hat linux & Free BSD : - support MD5-based Passwd - password can be of any length - first 3 chars are always “$1$” - Example: cat /etc/shadow xsha1:$1$idu0aciu$4lpNuUhs..:11842:0:99999:7:::

Password Security Don’t leave encrypted password in plain view. Shadow Password mechanism Placing them in a separated file that is not world readable Hint: on Solaris, shadow passwd is required! Must modify the shadow passwd file when adding or removing user to keep it consistent with /etc/passwd (p82)

UID number 32 bit integers from 0 – 2,147,483,647 Suggest: 0 – 32,767 Root has UID 0 Assign UIDs to real users starting at 100

UID number cont. Big no: never create multiple accounts with UID 0 if people need to have alternate way to login as root, using a program likes sudo(p41). Avoid recycling UID - prevent confusion if files are later restored from backups in which user are identified by UID rather than a login name. - keep unique across your entire organization a UID -> same login name -> same person

UID number cont. Multiple administrators/ organizations Central DB contains record for each user and enforces uniqueness(uniquid). Assign each group with an organization a range of UIDs and let each group mange its own set Side effect: Keep the UID space separate, but does not address the paralle issues of unique login names.

Default GID number 16 or 32 bit integer Signed or unsigned GID 0 is reserved for “root” or “wheel” GID 1 is usually for “daemon” Allow a user to be in up to 16 groups at a time, so GID is never used to determine access.

GECOS field No well-defined syntax Commonly used to record personal information about each user. Command: - who - finger a_user - chfn a_user (full name, office, office phone, home phone)

Home directory Users are placed in their home directories when they log in. Some sys allow the login to proceed and put the user in the root directory. Others do not. If home directory are mounted over NFS, they may be unavailable in the event of server or network problems.

Login Shell A command interpreter Bourne shell(/bin/sh), C shell(/bin/csh) ksh, bash, tcsh Sh is the default on most systems and is used if /etc/passwd doesn’t specify a login shell. Select/add a shell : /etc/shells

6.2 The FreeBSD /etc/master.passed File The “real” password file Master.passwd file function as a shadow password file in that it is readable only by root. 3 additional fields - login class - passwd change time - expiration time

6.3 the FreeBSD /etc/login.conf File Sets account – related parameters for user and groups of users. When user logs in, the login class field of /etc/master.passwd determines which entry in /etc/login.conf to apply. If no login class has been specified by the user’s master.passwd entry, the default class is used.

6.4 The Solaris and Red Hat /etc/shadow File 1. readable only by the superuser and serves to keep encrypted passwords safe from prying eyes. 2. Provides account information that is not available from /etc/passwd. 3. The shadow file is not a superset of the passwd file, and the passwd file is not generated from it. Must maintain both files by hand.

/etc/shadow millert:inNO.VAsc1Wn.:11031::180:14:: Login name 2. Encrypted password 3. Date of last password change 4. Min. number of days between password changes (better unset) 5. Max.number of days between password changes 6. Number of days in advance to warn users about password expiration 7. Number of inactive days before account expiration(solaris) 8. Account expiration date 9. flags

6.5 The /etc/group Contains the names of UNIX groups and a list of each group’s members. example: Student : * : 200 : dotty,mike,scott Encrypted password GID number List of members Group name

6.6 Add users Required: 1. Edit the passwd and shadow files to define the user’s account. 2. Set an initial password. 3. Create the user’s home directory

Add users cont. For the user: 1. Copy default startup files to the user’s home directory. 2. Set the user’s mail home and establish mail aliases.

Adding users cont. For you: 1. Add the user to the /etc/group file. 2. Configure disk quotas. 3. Verify that the account is set up correctly.

Adding users cont. Edit the passwd and shadow files 1. vipw (allow only one person to edit) 2. vi /etc/passwd Edit /etc/group file 1. Vigr

Adding users cont. Setting an initial password # passwd user Suggestion: replacing the system’s passwd command with an updated version that checks prospective passwords for guessability before accepting them(such as npasswd).

Adding users cont. Creating the user’s home directory # mkdir /home/staff/tyler # chown tyler /home/staff/tyler # chgrp staff /home/staff/tyler # chmod 700 /home/staff/tyler

Adding users cont. Copying the default startup files Begin with ‘.’, causes ls to elide these file from directory listings unless ‘-a’ option is used. End with ‘rc’, short for “run command”.

Adding user cont. Command sequence for installing startup files # cp /usr/local/lib/skel/.[a-zA-Z]* ~/tyler # chmod 644 ~tyler /.[a-zA-Z]* # chown tyler ~tyler /.[a-zA-Z]* # chgrp staff ~tyler /.[a-zA-Z]* Edit the /etc/group file example: Wheel:*:0:root,evi,garth,scott,trent,tyler

Setting disk quotas Set quota limits for each new account with the edquota command. # edquota –p proto-user new-user

Adding users cont. Verify the new login Login as the new user % pwd /*verify the home directory*/ % ls –la /* check owner/group of startup files*/ * Remind new user to change their passwords immediately

Removing users Involves removing all references to the login name that were added by you or your adduser program. Set the user’s disk quota to 0, if quota are in use. Remove the user from any local user databases or phone lists. Remove the user from the aliases file or add a forwarding address.

Adding users cont. Remove the user’s crontab file and any pending at jobs. Kill any of the user’s processes that are still running. Remove the user from the passwd and group files. Remove the user’s home directory. Remove the user’s mail spool.

Adding users cont. Quot: # quot /home Number of disk blocks consumed by each user Which UIDs are not list in /etc/passwd To find exact paths # find –x /home –nouser -print

6.8 Disabling logins Before network : put * in front of the encrypted password. Now : replace the user’s shell with a pseudo- shell Problem : sendmail will not deliver mail to a user whose shell does not appear in /etc/shells. Solution: defeat sendmail’s default behavior by adding a fake shell name /SENDMAIL/ANY/SHELL/ to the /etc/shells

6.9 vendor-supplied account management utilities Useradd -> add user Usermod -> change the passwd entries of existing users Userdel -> remove a user from the system Groupadd, groupmod, groupdel -> operate on the /etc/group file

Account management utilities #useradd cindy Cindy:*:105:20::/home/hilbert:/bin/sh #useradd –c “Cindy King” –d /home/math/cindy –g faculty –G famous –m –s /bin/tcsh cindy Cindy:*:105:30:Cindy King:/home/math/cindy:/bin/tcsh Add group, create directory, entry in /etc/shadow

Acount management utilities Determine default #useradd –D Set default /etc/default/useradd Set expiration date #usermod –e “June 6,2002” cindy Delete account (remove in passwd shadow group, except home directory) #userdel cindy