|
網誌存檔
熱門網志
|
|
|
Every user who has access to a Linux system needs a login and a password. Each user must belong to a primary group and for security or access purposes can belong to several secondary groups. In order to create new logins, modify or delete users, you must already be logged in as root. The root login is the highest level and only certain individuals should have access to the root account. useradd - Adding a new userOptions:
Example: To add a new user with
useradd -gusers -Gmgmt -s/bin/shell -pxxxx -d/home/roger -m rogerusermod - Modifying existing userOptions:
Example: To add the group `others` to the user roger usermod -Gothers rogeruserdel - Deleting a userOptions:
Example: To remove the user `roger` and his home directory userdel -r rogerpasswd - User`s PasswordOptions:
Example: To change the password for the account you are currently logged in as...
Example: To change the password for the user `roger` (only you are logged in as root)...
Where user and group information storedUser names and primary groups are stored in /etc/passwd. This file can be directly edited using the `vi` editor, although this is not recommended. Format of the file is...
Each field is separated by a colon. Passwords for each user are stored in /etc/shadow. This file should only be changed using the passwd command. Group information is stored in /etc/group. This file can be directly edited using the `vi` editor. Format of the file is...
Each field is separated by a colon. Default files When a new user is created, the default files and directories that are created are stored in /etc/skel. This directory can be modified to fit your needs. Modifications only effect new users and does not change anything for existing users. su - Switch UserTo switch to another user, use the su command. This is most commonly used to switch to the root account.
|
-------------------------------------------------
| 上一篇:How to write a shell script | 下一篇:巧用tmpfs加速你的linux服务器 |

