Passwd mary

Changing password for user mary. New password: ******* Retype new password: *******

Asterisks in this example represent the password you type. Nothing is actually displayed when you type the password. Also keep in mind that running passwd as root user lets you add short or blank passwords that regular users cannot add themselves.

In creating the account for Mary, the useradd command performs several actions:

■ Reads the /etc/login.defs file to get default values to use when creating accounts.

■ Checks command-line parameters to find out which default values to override.

■ Creates a new user entry in the /etc/passwd and / etc/shadow files based on the default values and command-line parameters.

■ Creates any new group entries in the /etc/group file. (Fedora creates a group using the new user's name; Gentoo adds the user to the users group; and SUSE adds it to every group you set for new users, such as dialout, audio, video, and other services.)

■ Creates a home directory, based on the user's name, in the /home directory.

■ Copies any files located within the /etc/skel directory to the new home directory. This usually includes login and application startup scripts.

The preceding example uses only a few of the available useradd options. Most account settings are assigned using default values. You can set more values explicitly, if you want to; here's an example that uses a few more options to do so:

Was this article helpful?

0 0
Digital Cameras For Beginners

Digital Cameras For Beginners

Although we usually tend to think of the digital camera as the best thing since sliced bread, there are both pros and cons with its use. Nothing is available on the market that does not have both a good and a bad side, but the key is to weigh the good against the bad in order to come up with the best of both worlds.

Get My Free Ebook

Post a comment