Linux Review basics of account and security

Source: Internet
Author: User

Accounts and Groups

1. Create Accounts and Groups

Useradd Create an account

-C Set Account description information

-D Set Account home directory

-e Set Account expiration date

-G Set the basic group of Accounts

-G set up an additional group of accounts

-M does not create home directories and is typically used in conjunction with-s

-S Set the login shell default to bash

Useradd-s/sbin/nologin

-U Specify account UID


2.groupadd creating groups

-G Set ID number


3.id

Describe account and group information


Modify accounts and Groups

1.password

+ User Change Password

Change account authentication Information

-L lock account, only root is available for this option

-U Unlock Account

-D Quick Erase password


2.usermod

Modify account information

-D Modify Account home directory

-e Modify Account expiration date

-G Modify the base group to which the user belongs

-G Modify the additional group to which the user belongs

-S Modify account login Shell

-U Modify account UID


3. Delete accounts and groups

Userdel

Delete accounts and related files

-R All Delete home directory

Groupdel

Delete a group account


Account information saved in/etc/password

Account password information saved in/etc/shadow

Group account information is saved in/etc/group

Group account password information is saved in/etc/gshadow


File and Directory Permissions

1.R W x

Viewing permissions with Ls-l

---------

Owner Group Other accounts

2. Modifying document properties

chmod

Eg:chmod 777 File name

chmod u=,g=,o= file name

chmod u:,g:,o: File name



ACL access Rights control

1.setfacl

eg:setfacl-m u::---file name



This article from "Big Plum" blog, declined reprint!

Linux Review basics of account and security

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.