Simple web server - Chapter 4 . Learning Basic Administration 145 When

Chapter 4 . Learning Basic Administration 145 When you choose a username, don t begin with a number (for example, 06jsmith). Also, it s best to use all lowercase letters, no control characters or spaces, and a maximum of 8 characters. The useradd command allows up to 32 characters, but some applications can t deal with usernames that long. Tools such as ps display UIDs instead of names if names are too long. Having users named Jsmith and jsmith can cause confusion with programs (such as sendmail) that don t distinguish case. Next, set Mary s initial password using the passwd command. You re prompted to type the password twice: # 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.) 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. (Red Hat 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: # useradd -g users -G wheel,sales -s /bin/tcsh -c Mary Smith mary In this case, useradd is told to make users the primary group mary belongs to (-g), add her to the wheel and sales groups, and assign tcsh as her primary command shell (-s). A home directory in /home under the user s name (/home/mary) is created by default. This command line results in a line similar to the following being added to the /etc/passwd file: mary:x:502:100:Mary Smith:/home/mary:/bin/tcsh Tip
Note: If you are looking for reliable webhost to maintain and run your java application check Vision java hosting services

Leave a Reply