In: Computer Science
C/C++ Programming in a UNIX Environment,
You should have read permission for the/etc/passwdfile. To answer the following questions, usecatorlessto display/etc/passwd. Look at the fields of information in/etc/passwdfor the users on the local system.
a.Which character is used to separate fields in/etc/passwd?
b.How many fields are used to describe each user?
c.How many users are on the local system?
d.How many different login shells are in use on your system? (Hint:Look at the last field.)
e.The second field of/etc/passwdstores user passwords in encoded form. If the password field contains anx, your system uses shadow passwords and stores the encoded passwords elsewhere. Does your system use shadow passwords?
a. Which character is used to separate fields in
/etc/passwd?
Ans: The special character "colon (:)" is used to separate fields
in etc/password
b. How many fields are used to describe each user?
Ans: There are 'seven' fields to describe each user.
i.e name, password, user Id, group Id, Full name of the user,
home-directory and shell
c. How many users are on the local system?
Ans: There is no fix number of users present in a system .it is
actually system dependentd.
to get all the user list you can use below command
$less /etc/passwd
to get the count
$getent passwd | wc -l
for me it is giving 34 users
d.How many different login shells are in use on your system? (Hint:
Look at the last field.)
Ans:it is also system dependente.
The second field of /etc/passwd stores user passwords in encoded
form. If the password field contains an x,
your system uses shadow passwords and stores the encoded passwords
elsewhere. Does your system use shadow passwords?
Ans: system dependent