Wednesday, September 10, 2008

Changing Your User Information in Ubuntu Linux

Linux users are assigned a name, known as a username, by the root operator. One method of assigning usernames is to use one's first initial and last name in lowercase; for example, Bernice Hudson would have a username of bhudson. Each user must also have a password, which is used with the username either at a graphical or text-based login.

Older versions of Linux operating systems limited the length of usernames to 8 characters. The current version of Ubuntu limits usernames to 32 characters. Good passwords should be a minimum of 8 characters long and contain uppercase and lowercase letters, along with numbers. Random passwords for users can be generated using the mkpasswd command. Good passwords are not birthdays, anniversaries, your pet's name, the name of your significant other, or the model of your first car!

You cannot change your username, but you can change your user information, such as address, phone, and so on. You make these changes using the chfn or change finger information command. This command will modify the contents of your entry in the system password file /etc/passwd, which is used by the finger command to display information about a system's user. For example, type chfn at the command line and press Enter:

$ chfn
Password:
Changing the user information for andrew
Enter the new value, or press ENTER for the default
Full Name: Andrew Hudson
Room Number [None]: 17
Work Phone [01225445566]: 01225112233
Home Phone [01225112233]: 01225445566

You are led through a series of prompts to enter new or updated information. Note that the chfn command will not let you use any commas when entering information. You can verify this information in a couple ways, for example, by looking at the contents of /etc/passwd:

$ grep andrew /etc/passwd
andrew:x:1000:1000:Andrew Hudson,17,01225112233,01225445566:\
/home/andrew:/bin/bash

You also can verify the updated user information by using the finger command:

$ finger andrew
Login: andrew Name: Andrew Hudson
Directory: /home/andrew Shell: /bin/bash
Office: 17, +0-122-511-2233 Home Phone: +0-122-544-5566
On since Tue May 30 20:54 (BST) on :0 (messages off)
On since Tue May 30 20:55 (BST) on pts/0 from :1.0
No mail.
No Plan.

Source of Information : Ubuntu Unleashed

No comments: