Linux User Management -4__linux

Source: Internet
Author: User
Tags command access

Bulk Add Users: Method one

NewUsers Import user information file file format

Pwunconv Cancel Shadow password function

The first step: newusers < 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 < 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.