Bulk Add Users: Method one
NewUsers Import user information file file format
Pwunconv Cancel Shadow password function
The first step: newusers < user.info file format is as follows: (will automatically create the host directory)
1 Newuser1:: 1001:3::/home/newuser1:/bin/bash
2 Newuser2:: 1001:3::/home/newuser2:/bin/bash
Step Two: Pwunconv
Part III: CHPASSWD < passwd.info import Password file file format is as follows:
1 newuser1:qq123456
2 newuser2:qq123456
Part fourth: Pwconv write password to shadow file
Method Two: Shell script (post-completion)
Restrict user Switching to root:
Groupadd Sugroup
chmod 4550/bin/su Remove other people's executable permissions
CHGRP SUGROUP/BIN/SU Change the group to which it belongs
You just need to add the user to the group.
Use echo $PATH to view directories where the current user can execute all commands
sudo command: Use sudo instead of SU when executing sudo command, temporarily become root to provide limited command access to users
Need to master the files/etc/sudoers sudo configuration file
/user/bin/sudo and/user/sbin/visudo (edit configuration file)
Format: User name (if group% Group name) host address = Authorized command (the absolute address of the command use which to query to the absolute address of the command, multiple separated by commas)
Use sudo plus the commands you can execute to execute root command
Apache Management
Profile httpd.conf only the root user can edit the file
Common User profile methods:
Method One: Change the owner of the configuration file
Method Two: Change the file belongs to the group, the user joins the group, grants the W permission
Method Three: sudo command user name host address =/bin/vi/etc/httpd/conf/httpd.conf authorized sudo httpd command of the authorized username address =/etc/rc.d/init.d/httpd Start, reload, Fullstatus, Configtest