Linux User group Permissions Recovery

Source: Internet
Author: User
Tags echo command

/ETC/PASSWD: This file is used to store user details: for example

Root:x:0:0:root:/root:/bin/bash

User ID 0: represents the root user

Bash under Bin: Indicates that you can log in to the operating system

Sbin under Nologin: Unable to log into the system

User name: Password: User id: Group ID: User description information: User Directory home directory: executable file

/etc/shadow: This file is used to hold the user name password.

/etc/group: for storing group IDs

root:x:0

Group name: Group password: Group ID

/etc/gshadow: for storing group passwords

Create a user In addition to the above files, also create a home directory named after the user name

/var/spool/mail/

Creating a user also creates a mailbox for the user

ID User name: Check if the user exists, and return the ID, view the user ID of the corresponding user, the user's group ID and in which group

Vim file name: Used to edit the file A,i,o Enter the edit mode ESC into the execution mode: Wq save exit Q means exit wq! Force save exit

If there is no corresponding edit permission, only the root is forced to save the exit

Vim loads the contents from the hard disk into memory, then overwrites the contents of the contents to the original content after modification and modification.

Echo: Echo command, echoes behind the content, it shows what content, similar to print

Useradd-u: Specify UID for User: Default is from 500 onwards

-G: Specify the group where the user resides

-D: Specify the user's home directory

-C: Specify user's Notes information

-S: Specify the user's shell

Userdel-r: Deleting users

ID View User

Change by command

Usermod Modify User:

Usermod-d: Modify the user's home directory: change only the user's profile, after the change must be in the home directory to create a home directory

USERMOD-AG Group members

Permission root user does not have permission to constrain

Ls-l

The last point in the permission information for the first set of files is the file that is created in the security case

-R W--------.

D r W x r-x r-x.

1: File type that represents the file

-Represents an ordinary text file

D stands for file directory

L: Represents a linked file

B: Device files

P: Pipeline File

9-bit, 3-bit group

2-4:

The owner's permission represents u

Divided into three categories: Read R corresponds to the number 4, write w corresponds to the number 2, perform x random number 1

5-7

Group's permission Mark G

8-10

Other user rights represent O

chmod: Modify Permissions

Example: chmod u-rw a.txt or chmod u = RW a.txt Modified is the master permission

Note: Only the owner of the file can modify permissions

Method of executing file: SH file path bash file path. File path./file path

Hard connection for second set of files

Who is the third group (owner)

Group Fourth (group)

Group Fifth File size

Sixth set of file creation date

Group Seventh file name

Permissions for the directory:

ll-d path name View user's directory permissions

R: Can ls the sub-file name under the directory, directory name

W: can be created, deleted, renamed in this directory

X: Can CD to this directory

Chown: Modifying a group of owners and genera

Example: Modifying two

Chown root root a.txt

Chown Root A.txt only modifies the owner

Chown. Root only modifies the genus Group

Recursive Modify Permissions

Chown-r: Modify permissions for directories and files under directories

Linux User group Permissions Recovery

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.