Configuring your account
Notes:
The passwd file:
-
On a unix system, the user database file is /etc/passwd. This file keeps
a list of all of the accounts on the system with some configuration data
for each account.
-
Each user has a one line entry in the passwd file; each line contains 7 fields
separated by colons as follows:
username:password hash:uid:gid:gecos:home directory:login shell.
The gecos data is your name,office,home phone,work phone,other
-
A sample line from the passwd file is:
abc:*:1004:100:Mr.
Alphabet:/home/abc:/usr/bin/flin
username: abc
password: *
userid: 1004
groupid: 100
name: Mr. Alphabet
home directory: /home/abc
login shell: /usr/bin/flin
Other commands to view or change data about your account.
-
id
shows your userid, groupid and all groups you belong to.
-
set
displays the name and value of each shell variable; this includes your terminal
type, your search path, your mail directory, ...
-
chfn
This command is used to change your personal information in the passwd
file.
-
chsh
This command is used to change your login shell.
Exercises:
-
Look at the entry in the passwd file for your account. What is your uid?
-
Look at the entry in the passwd file for floopy. What is the shell?
-
What is your uid; what is your current gid; what groups are you a member
of?
-
What is the name of the file that is checked for incoming mail? (MAIL) What
is your terminal type? (TERM) What is your path? (PATH)
-
Use the chfn command to enter home and office phone numbers for your account.
Look at your entry in the /etc/passwd file. Are the phone numbers stored
there? Use the finger command to finger your own account. Are the phone numbers
displayed?
-
Change your login shell to /usr/bin/flin. Logout and login again. You should
be running flin (a menu based shell). Check your entry in the passwd file.
Was the login shell changed.
Copyright ©
L.M.MacEwan