• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/9

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

9 Cards in this Set

  • Front
  • Back

What is the password file?

UNIX requires numerous data files for normal operation, the password file is one of them.


-This file is used everytime a user logs in to a UNIX system and everytime someone does a ls-l command.




-The password file is stored in /etc/passwd


-This file is an ASCII file that is a passwd structure with a bunch of entries.


-Entry with the username root, has a user ID of 0.

What is an encrypted password?

A field in the passwd structure that contains a single character as a placeholder.




-It is a copy of the user's password that has been put through a one-way encryption algorithm.


What is a shadow password?

The file where new systems store the encrypted password. This file has to contain the username and the encrypted password.


-Should not be readable by the world, only login(1) and passd(1) need access.

finger(1)

-this is a user information lookup program.


-Displays information about the system users.

chfn() & chsh()

-used to add or change user database information.




chfn(): Change information in password file


chsh(): change your login shell

What does the group file contain?

/etc/group




group name, encrypted password, numerical group ID, and an array of pointers to individual usernames.

Functions for program access

getpwent(void)


-We call this function to return the next entry in the password file. Returns a pointer to a structure that is has filled in.




setpwent(void)


-Rewinds whatever files it uses




endpwent(void);


-closes these files.


-Must remember to use this when using getpwent.

Functions to fetch entries from the password file?

getpwuid(uid_t uid);


-Used by the ls(1) program to map the numerical user ID contained in an i-node into a user's login name.




getpwnam(const char *name);


Used by the login(1) program when we enter our login name.




-Both return a pointer to a passwd structure that the functions fill in.

Group versions:

getgrid, getgrnam, getgrent, setgrent, endgrent