分类:
2007-09-08 23:40:04
User management
User is a very important object for system .So as a system must have user. Follow information about user management.
User create
Syntax : useradd option username
-u user_id
-o # to allow user using exist user id
-g group_name
-G second_group_name
-c “note” # user note
-d user_home #to special user home local
-m #to creating user home
-s shell _path #to special uses shell path
For example :
useradd –u 100 –g root –G bin –c “printer_administrator” –d /export/home/oracle –m –s /bin/bash oracle
默认情况下创建的用户是被锁定的,管理员必须为其设置密码。
User modified.
Syntax : usermod option username
Option is the same as option of useradd.
-l new_name #rename for user
User delete
Syntax : userdel option user_name
-r #delete user and user’s home
Group create
Syntax : groupadd option group_name
-g group_id # to special if of gorup
-o #allow user using exist group id
Group modified
Syntax: groupmod option group_name
-g # to modified id of gorup
-n new_group_name # to rename for special group
Group delete
Syntax : groupdel group_name
Password management
Set password : passwd username
Get information about password: passwd option username
-l #l to lock user account
-d # to delete user password
-s # display user account state
File about user
/etc/passwd 用户信息数据库
/etc/group 组信息数据库
/etc/shadow 加密密码信息数据库
/etc/default/login 定义了登陆相关的设置
/etc/default/passwd 定义了密码的默认设置
Shell about user
B-shell
K-shell
C-shell
Other command about user.
uptime # to get information about system
who # to display all user that have logined
who am i # to display current user