User Accounts

Types of User Accounts

The root Account

Regular User Accounts

Non-Regular User Accounts

Unix Groups

User and Group Files

Fields in the /etc/passwd File

Fields in the /etc/group File

Shadow Password System

One-way encryption ("secure Hashing"): How does it work?
$ echo "some string of characters" | md5sum
$ echo "short" | md5sum
 
  • Unix password database contains hashes
  • When user types their password, the hash function is applied and compared to the stored hashed password
  • In theory, the password can't be recovered from the hash
  • In practice, users pick bad passwords which are easily guessed
  • PAM (Pluggable Authentication Modules)


    Highly configurable authentication scheme:

  • allows you to configure your environment for the level of security you feel you need.
  • Loadable modules that handle the authentication tasks for all applications and services on the system.
  • login, samba, pop, sshd ...
  • Better than having each each service or application implement its own security policy
  • /lib/security /etc/pam.d The configuration files contain 4 fields: Field 1:
     
     
    module-type 
    (Management Task)
    Description
    auth Prompts user for identification such as a password. options: nullok, nodelay
    account checks account info, ensures user account and password are active
    session Sets up logging for application
    password Allows users to update password. options: nullok, md5, shadow, remember=n

    Field 2:
     
     
    Control Flag Description
    required Success of the module is required, failure is not reported until all modules have  executed. So user doesn't know where they failed in the process.
    requisite Success of the module is required, failure causes PAM to return immediate failure to the calling application. Faster but hosile users know where they failed in the auth stack
    optional Success or failure have no affect on the calling application
    sufficient If this module succeeds all the remaining modules are ignored, returns immediately to calling program. You might allow less stringent checks on your laptop then on your workstation...

    * In the above example, all four entries use the control flag required. This means all four modules must return successfully for the password change to work.

    Arguments:

    Locking users out via PAM

    # less /etc/pam.d/login
    auth     required   /lib/security/pam_securetty.so
    auth     required   /lib/security/pam_stack.so service=system-auth
    auth     required   /lib/security/pam_nologin.so
    account  required   /lib/security/pam_stack.so service=system-auth
    password required   /lib/security/pam_stack.so service=system-auth
    session  required   /lib/security/pam_stack.so service=system-auth
    session  optional   /lib/security/pam_console.so
     
  • pam_nologin.so  will prevent users from logging into the system if the file /etc/nologin exists.
  • The contents of /etc/nologin is displayed during login attempt

  • 1. Create the file /etc/nologin

    # echo "Sorry, no joy today" > /etc/nologin
    2. Type <Cntr><Alt><F2> to access a virtual console
    3. Try logging in as userxx on your workstations
    4. What happened?
    5. Delete the /etc/nologin file and try logging in again

    Running Crack to check user password on your system

    Creating New User Accounts

    Changing User Passwords

    Characteristics of Good Passwords

    Creating New Groups

    Modifying User Accounts

    Automating Home Directory Creation

    Creating Aliases to Make Life Easier for your Users

    *You can add your aliases to the .bashrc file in your home directory.