SOLARIS 10 USER ADMINISTRATION
WHAT IS SOLARIS ?
Solaris is one of the open source Unix based operating systems.
An operating system is a building block of a computer system which acts as the interface between user applications and computer hardware
In Unix based operating systems we use commands mainly to interact with the system.
Solaris 10 is a multiuser, multitasking, multithreading operating environment, developed and sold by Sun Microsystems
INTRODUCING USER ADMINISTRATION
An important system administration task is setting up user accounts for each user who requires system access. Each user needs a unique account name, a user identification (UID) number, a home directory, and a login shell. You may also have to determine which groups a user may access.
MAIN COMPONENTS OF A USER ACCOUNT
A user account mainly comprise of User name – A unique name that a user
enters to log in to a system. The user name is also called the login name.
Password – A combination of up to 256 letters, numbers, or special characters that a user enters with the login name to gain access to a system.
UID number – A user account’s unique numerical identification within the system.
Group identification (GID) number – A unique numericalidentification of the group to which the user belongs
Comment – Information that identifies the user. A comment generally contains the full name of the user and optional information, such as a phone number or a location.
User’s home directory – A directory into which the user is placed after login. The directory is provided to the user to store and create files.
User’s login shell – The user’s work environment is set up by the initialization files that are defined by the user’s login shell.
SOLARIS 10 DEFAULT USER ACCOUNTS
There are several Solaris 10 default user accounts such as root,nobody,noaccess and many.
The root default user account(UID 0) is the most important account as it provides access to the entire system. It has almost no restrictions and overrides all other logins, protections, and permissions.
MANAGING USER ACCOUNTS
The Solaris OS provides these commands for managing user accounts
useradd – Adds a new user account on the local system
usermod – Modifies a user’s account on the local system
userdel – Deletes a user’s account from the local system
ADDING A NEW USER TO THE SYSTEM
To add a new user to the system a useradd command is used as follows
useradd [ -u uid ][ -g gid ][ -G gid [,gid,.. ]]
[ -d dir ][ -m ][ -s shell ][ -c comment ] login name
The command is analyzed in the next slide
-u uid --Sets the UID number for the new user-g gid --Defines the new user’s primary group-G gid --Defines the new user’s secondary groupmemberships-d dir --Defines the full path name for the user’s homedirectory-m --Creates the user’s home directory if it doesn’t exist-s shell --Defines the full path name for the shell program of the user’s login shell–c comment --Specifies any comment, such as the user’s full name and locationlogin name --Defines the user’s login name for the user account-D --Displays the defaults that are applied to theuseradd command
Example
useradd -u 1000 -g other –d /export/home/eliakim -m -s /bin/ksh –c "Regular User Account" eliakim
NBIn Solaris we have Korn Shell(ksh),C shell(csh),Bourne Shell(sh),Bourne Again Shell(bash)
After creating a user account a passwd command should be used to assign a password to that account # passwd eliakimNew Password: password1Re-enter new Password: password1passwd: password successfully changed for eliakim
Since the password is a user’s secrecy it is wise for the administrator to instruct the system to prompt the new user created to change his password on first login. This is achieved by using the command passwd –fi.e. # passwd -f eliakim
The useradd command has a preset range of default values. These values can be displayed using the useradd -D command. When this command has been used for the first time, the useradd command generates a file called /var/sadm/defadduser that contains the default values. If the contents of this file are amended, the new contents become the default values for the next time the useradd command is used. To create a new user account based on the default values just use the useradd command with the –m option onlyi.e. useradd -m eliakim
MODIFYING USER ACCOUNT
The usermod command is used for changing the user’s particulars .The following is the syntax for the usermod command:
usermod [ -u uid [ -o ] ] [ -g gid ] [ -G gid [ , gid . . . ] ] [ -d dir ] [ -m ] [ -s shell ] [ -c comment ]
[ -l new login name] login name
The command is analyzed in the next slide
-o --Allows a UID to be duplicated.-m --Moves the user’s home directory to the newlocation specified with the -d option.-l newloginname --Changes a user’s login name for the specified user account.-f inactive --Sets the number of inactive days that are allowed on a user account. If the account is not logged into for the specified number of days, it is locked.-e expire --Sets an expiration date on the user account. Specifies the date (mm/dd/yy) on which a user can no longer log in and access the account. After that date, the account is locked.login name -- Identifies the user’s login name for the current user account.
Example
The following example changes the login name and home directory for user eliakim to charles.
# usermod -m -d /export/home/charles -l charles eliakim
DELETING USER ACCOUNT The userdel command is used to delete a
user’s login account from the system. The following is the command format for the
userdel command: userdel login name The userdel command also removes the user’s
home directory and all of its contents if you request it to do so. Use the -r option to remove the user’s home directory from the local file system. This directory must exist.
The following example removes the login account for a user named eliakim.
# userdel eliakim
To request that both the user’s account and home directory be removed from the system at the same time, perform the command: # userdel -r eliakim
NB: The userdel does not remove all the files associated with the user.
END OF PRESENTATION
Prepared by Eliakim Mwakapiso