Ubuntu User/user group management

Source: Internet
Author: User
Tags tomcat

1: View all groups of users

Cat  /etc/group
ftpgroup:x:1001:ftpadmin

Ftpgroup is a user group and ftpadmin is a user of this group

1) Create user groups

Groupadd Ftpgroup

2) Delete user group

Groupdel Ftpgroup

2: View Users

Cat/etc/shadow
ftpadmin:$6$8qc/zlcz$zan/ Nx.dg5o4lb87z86gpsmnhvghdynvc1tt0m.nraurw.5rfrfowj9ngp6gpzuwqvmjrihx.. Hd7awpyjzuy/:15678:0:99999:7:::

Ftpadmin is the user name

1) Create user

Useradd ftpadmin-d/usr/local/tomcat/apache-tomcat-7.0.33/webapps/-G ftpgroup
passwd ftpadmin  //Set Password

-d Specifies the user's home directory

The group to which-G belongs.

But when I performed cat/user/group, I found that there was no user ftpadmin

FTPGROUP:X:1001:
So I executed 3 of the instructions I wrote.

2) Delete User

Userdel Ftpadmin

3: Add the user to the specified user group

Gpasswd-a ftpadmin ftpgroup
Adding user ftpadmin to group Ftpgroup

4: View the user and the user's home directory and other information

VI  /etc/passwd
User
Ftpadmin:x:1001:1001::/usr/local/tomcat/apache-tomcat-7.0.33/webapps/:/sbin/nologin



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: info-contact@alibabacloud.com 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.