Monthly Archives: February 2006

How do you change your Unix password?

The first thing you do when you get a new Unix account is change the password. No one should know your password, except you. Default user passwords given by many system administrators may follow a simple pattern (password100, 12345, etc). It is your responsibility to change this the first time you access the system.

Log in to your Unix account (locally or remotely) with your current username and password. The messages may change from system to system, but the basics will be the same. Note that passwords are usually case sensitive.

The command to change your password is passwd. At the command prompt, type:

passwd

Hit enter. The system will say something like:

Changing password for {username}

Where {username} is your account log in name.

Enter current password:

Type in your current password and hit enter.

New password:

Type your new password and hit enter.

Retype new password:

Retype your new password to make sure you didn’t enter it incorrectly.

passwd: all authentication tokens updated successfully.

How to make a good password

Effective account protection is a two-party effort. The user needs to be educated on good and bad password techniques, and the system administrator has to allow for human nature while still securing their system.

In this post, we will discuss a few ways to get users to create reasonable passwords.

Better passwords are random passwords

One method to make decent passwords is to use very random characters. That’s tougher than you might think. If software can create it, then software can guess it. Some people might want to use electrical noise or atomic decay as a password
salt, but now we are getting really geeky.

Initial character passwords

The average user can get away with something much easier. Just come up with a phrase that is at least 8 or 10 words long and start having some fun with it. When January 2000 rolled around, my monthly password (my account was changed every 23 to 32 days) was based on a phrase like this:


The year 2000 bug has gone away… see ya!

Which would be shortened to:


tY2kbHGa–>CYA!

Since this is now publicly exposed, it should never be used by anyone again. If you have ever seen an example of a good password, then it’s not good anymore.

Passwords based on lyrics or sayings

Some people base a password on a song’s lyrics or some phrase. Let’s see what we come up with a few minutes of playing around.

Hey Jude, don’t make it bad. Take a sad song and make it better
This is a very popular Beatles song from 1968. It is longer than 10 words and it is easy to remember if you know the song, so it could work as a start of a basic password.

HJdmibTasSamib
We take the first character of each word and mix the case up. That looks like a decent password, except that millions of people know that song, and might try the same combination. It’s a good first step, but needs a little more tweaking.

HJ ,dm1b. T@sS&mIb!
Basic character substitution, like changing the letter ‘a’ to ‘@’ looks good to most users, but as we mentioned in other posts, it’s so common that it is easily cracked. However, the addition of some basic punctuation and spaces can help.

HJ ,dm1b. T@sS&mIb!1968
The addition of numbers makes it even more unique. Some might argue that using the date of the song is still rather weak, but in reality, this is a pretty decent password.

It is true that putting extra information at the beginning or the end of common passwords is a proven pattern, but that’s more for passwords like 1969FordMustange (more common than you think) or Sandra1972 (even worse, as it is only a single word and date).


HJ ,dm1b. 1968 cha-cha-cha T@sS&mIb!
Ok, now we moved the date inside the password, and added some stuff that has nothing to do with the song. While this isn’t a random password, it is certainly unique enough to be reasonable. If you make something up like this yourself, and you remember the pattern or logic in how you made it, then you can come up with a combination that is easy for you to remember but hard for others to guess.
Passphrases

Some people will simply make a short sentence their password. If you have a password of several words, complete with punctuation and spaces, you have an easy to remember password that is longer than 8 characters, contains no personal information, and is not in a dictionary.
Add some funky spelling and other characters and numbers, and you should be fine.

  • i-H8TEmodays, don’t u?
  • WhydoIHave2000passWorz?!?
  • MyBossIsGreat;i’m*self*employed!

Of course, since no one should ever know your password, you can type things about your boss that you would never actually say 😉 Be careful, sometimes these passwords do get out.

Phonetic Passwords

You can make up your own nonsense word that means nothing but is speakable and easy to remember. Phonetically, these can be spoken (in your head) when you are learning them:

  • yo-mah, suTEEy8t
  • dach,Tez.CHi’set
  • pL8t.=,Sk8t
Use multiple passwords for multiple accounts

Remember to use different passwords for all of your accounts. This is a pain, but a necessary evil. If someone cracks one of your passwords, they cannot get into everything you have.

For example, imagine that someone uses their parent’s phone number for all of their banking PINs, online bill payments, work and personal email passwords, and so on. Once someone finds out that password, they are going to try it everywhere.

Don’t make it any easier for the bad guys.

In theory, every password you have should be totally random and unrelated to anything.

(Good luck with that,
human nature goes against it.) If you are given 12 passwords for 12 different systems that are totally random, chances are you are going to record them or forget them (or both). The average person will not memorize a dozen passwords, especially if they are not all used daily or if they change too often.

Different people handle this problem in different ways.

Some might use a passbook or a keychain system, where all their passwords are encrypted in a single, reasonable secure way. They would have one ‘master password’ to open the keychain and access whatever other password they need to use. This is popular, as the user only needs to really remember 1 strong password (it had better be strong!) and allows them to have many passwords for many systems.

It does, however, have some drawbacks. First, if the master password is lost or forgotten, then all their passwords are lost or forgotten. Second, if the master password gets cracked, then all of their passwords are exposed.

Another thing that some people try to do is have a common base password that they build other passwords on. For example, let’s assume that a person has to use several systems, and that they want a unique password for each.

  • Work email
  • Personal email
  • Work computer 1 (local Windows workstation)
  • Work computer 2 (Unix server)
  • Personal computer (Macintosh)

Maybe they come up with a password root based on some of the examples earlier like

G^3d’a-,fc
. They might then use that as a basis for their different passwords:

  • Work email:

    G^3d’a-,fc-WorkEmail
  • Personal email:

    G^3d’a-,fc-HomeEmail
  • Work computer 1 (local Windows workstation):

    G^3d’a-,fc-WorkWin2k
  • Work computer 2 (Unix server):

    G^3d’a-,fc-WorkUnix
  • Personal computer (Macintosh):

    G^3d’a-,fc-HomeMacOSX

The base of the password is reasonable, and the extension isn’t always the same pattern, so if one password is exposed, the others still have a chance of being secure until they can all be changed to something new. If a password does get exposed change them all (you should be changing passwords every now and then anyway).

Technically, if you are going to use this method, you might reverse the order and have the unique part of the password first, and the common parts near the end. This way, if someone is casually watching you type, it looks like a completely different password, and so it’s harder to find a pattern.

In other words, using the above example, you might use this:

  • Work email:

    WorkEmail-G^3d’a-,fc
  • Personal email:

    HomeEmail-G^3d’a-,fc
  • Work computer 1 (local Windows workstation):

    WorkWin2k-G^3d’a-,fc
  • Work computer 2 (Unix server):

    WorkUnix-G^3d’a-,fc
  • Personal computer (Macintosh):

    HomeMacOSX-G^3d’a-,fc

The first part of the password helps scramble the repeating pattern that is common to all of them.

Unix accounts primer

This is a quick primer on what Unix accounts are and the different roles that they can have. While the terminology being used is for Unix (and Linux/Mac OS X), the ideas can be used for some other systems as well.

What is an account?

Unix and Linux computers were designed to have many different people (accounts) using the same computer at the same time, remotely connected by networks.

Each account is separate from every other account; so one person’s work will not interfere with another person’s work on the same system, even if they are both using the system at the same time.

Normally, a Unix system requires you to authenticate yourself (prove that you have access rights) before it will let you use system resources. This helps determine such things as what resources you are allowed (printers, applications, etc), where to put your files, the types of permissions you have, and what preferences you have set for your work environment.

To authenticate you, most Unix systems ask for a username (account name) and password. The combination of the two helps determine what you are allowed to use and do once you log in.

How many accounts should you have?

Different accounts for different privileges

Unix is a multi-user system, and not all users need to have the same privileges. Here are a few examples of the different roles you might see on any given system.

User accounts

This is a normal account. A user account has limited access to anything outside of their work environment. They might create and edit documents, run applications and utilities, and other normal day-to-day work.

They usually cannot change system settings that would affect other users, only themselves. They can only modify their own account and preferences.

If you think in terms of keys and responsibilities, a user account only has a key to their own office space. They do not have keys to other people’s offices or to the front doors of the building. If you lose that one key, only one office might be compromised and only one lock needs to be changed.

There are usually many different users on a Unix system.

Administrator accounts

Administrators have more responsibilities than regular user accounts. They might be able to create/modify/delete other users, change system-wide settings, install software or hardware, and perform maintenance or upgrades that affect all users.

Experienced administrators only log in with these privileges when they need to. They usually use a regular user account when doing day-to-day work. This least-privilege-required mentality helps the overall security of the system.

To continue on with our keys analogy, the administrator is like a custodian. They have keys to many offices, in addition to broom closets, electrical panels, and so on. If the keychain is lost, many locks need to be changed, and a serious security breach has occurred.

There may be more than one administrator for a Unix system.

Superuser (root) accounts

The

superuser
, or

root
, account is the most powerful account on a Unix system. They can do anything, delete any files, and can cause complete chaos if in the wrong hands. Many system administrators will only use the root account when they have to, and then switch to a lesser account as soon as they have completed the task required.

The root user has the ‘skeleton’ key. It opens all doors in the building. If it gets lost, people lose their jobs.