Password

From Hackepedia
Jump to navigationJump to search

Access to a UNIX system historically was granted by means of passwords. These consisted of all keys on a typical US keyboard and were at first limited in length. Implementations exist for one time passwords also called skey. Another method for access to UNIX systems are Kerberos passwords. A Unix system is not limited to it's own password database to grant access to users, alternative are NIS or using PAM for a variety of password implementations.

How to change a password

To change your password type passwd and the system will ask you to enter your current password as a security measure, unless you are root.

$ passwd
Changing local password for user.
Old password:
New password:
Please enter a longer password.
New password:
Please don't use all-digit passwords.
Please use a different password. Unusual capitalization,
control characters, or digits are suggested.
New password:
Retype new password:
Mismatch; try again, EOF to quit.
New password: ^D
Password unchanged.
$

Note: passwords are never echo'ed and don't display a * or other sign per character typed. This is to ensure that noone can get an idea of how long your password is which would greatly ease their cracking efforts. If you ever see your password displayed as you type it, abort immediately and search for causes why it doesn't work right, contact your system administrator.


How to program with password authentication

Examples are the login(1) source code. Easy functions explaining password operations include the getpwent(3) and getpass(3) manual pages as well as crypt(3).