Книга: Fedora™ Unleashed, 2008 edition

Adding New Users

Adding New Users

The command-line approach to adding any user is actually quite simple and can be accomplished on a single line. In the example shown here, the sysadmin uses the useradd command to add the new user bernice. The command adduser (a variant found on some UNIX systems) is a symbolic link to useradd, so both commands work the same. In this example, we use the -p option to set the password the user requested; we use the -s option to set his special shell, and the -u option to specify his UID. (If we created a user with the default settings, we would not need to use these options.) All we want to do can be accomplished on one line:

# useradd bernice -p sTitcher -s /bin/bash -u 507

The sysadmin can also use the graphical interface that Fedora provides, as shown in Figure 10.1. It is accessed as the Users and Groups item from the System Settings menu item. Here, the sysadmin is adding a new user to the system where user bernice uses the bash command shell.


FIGURE 10.1 Adding a new user is simple. The GUI provides a more complete set of commands for user management than for group management.

These are the steps we used to add the same account as shown in the preceding command, but using the graphical User Manager graphical interface:

1. Launch the Fedora User Manager graphical interface by clicking the Users and Groups menu item found in the System, Administration.

2. Click the Add User button to bring up the Add User dialog window.

3. Fill in the form with the appropriate information, as described in the first paragraph in this section.

4. Click the drop-down Login Shell menu to select the bash shell.

5. Check the Specify User ID box to permit access to the UID dialog.

6. Using the arrows found in the UID dialog, increment the UID to 5413.

7. Click OK to save the settings.

Note that the user is being manually assigned the UID of 549 because that is her UID on another system machine that will be connected to this machine. Because the system only knows her as 549 and not as bernice, the two machines would not recognize bernice as the same user if two different UIDs were assigned.

NOTE

A Linux username can be any alphanumeric combination that does not begin with a special character reserved for shell script use (see Chapter 11, "Automating Tasks," for disallowed characters, mostly punctuation characters). Usernames are typically the user's first name plus the first initial of her last name, something that is a common practice on larger systems with many users because it makes life simpler for the sysadmin, but is neither a rule nor a requirement.

Оглавление книги

Оглавление статьи/книги

Генерация: 1.139. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз