Discussion on the control of authority management, process and service under Linux system

Source: Internet
Author: User

One, the management of file permissions

1, the existence of the meaning of permissions
For security
2, the recognition of rights
Ls-l Permissions for file files

Ls-ld permissions for the dir directory

3. View and understanding of permissions

  • rw-r--r--1 root root 216 may File1 (pictured first)
  • [1] [2] [3] [4] [5] [6] [7] [8]
    [1] indicates file type
  • Normal file
    Catalog D
    L Soft Connection
    s socket
    C-Character device (device that displays characters)
    [2] File permissions
    rw-|r--|r--
    U g o
    U:user What users can do with files
    G: What group members can do
    O:other
    [3] Number of hard links to file, that is, the number of file content recorded by the system
    [4] File owner
    [5] File owning group
    [6] File size
    [7] The last time the file was modified
    [8] Name of the file
    Directory
    D rwxr-xr-x. 2 root 4096 Jul 09:05 test (pictured second)
    [1] [2] [3] [4] [5] [7] [8]
    [1] Type
    [2] Permissions
    [3] Number of subdirectories in the directory
    [4] User
    [5] Group
    [6] Sub-file or subdirectory meta-data size
    [7] Last modified time
    [8] Name
    Metadata: Describes the user's data called metadata, the properties of the file
    4. Modify users and user groups-1
    1. This command must be performed by the root user
    Chown Username File|dir Change file owner
    Before the file changes

    After the file changes

    Before directory changes

    After the catalog has changed

    Chown-r username File|dir Change the contents of the file inside the owner
    Before the change

    After the change

    Chown username:group file|dir changing file and directory Users and user groups
    Before the change

    After the change

    CHGRP Group File|dir
    Chgrp-r roup dir
    5. File permissions
    R
    Whether the file can view the contents of the file
    Whether the directory can view files in the directory
    W
    Whether the file can change the characters recorded in the file
    X
    A program that can invoke a file within a file by its name
    Whether the directory can enter this directory
    2) Management of permissions
    chmod <u|g|o> <+-|=>r|w|x> File|dir
    # #数字方式
    Rwx
    210
    x=20*0|1=1
    w=2*10|1=0|2
    r=2
    2*0|1=0|4

X=1
w=2
R=4

Rwx=7
Rw=6
R-x=5
R--=4
-wx=3
-w-=2
--x=1
chmod 755/mnt/file
chmod 777 File1
Before the change


After the change

Rwxr-xr-x
6. ACL
Specific users have specific permissions for specific users
Getfacl file

[[email protected] mnt] # getfacl file
File name
#owner: Root file Owner
#group: Root User All Groups
USER::RW User Rights
User: Specific users: RW Specific user rights
group::r--User group permissions
MASK::RWX Permission Maximum Value
Other:: Permissions for other people

setfacl-m u: User name: Permission (rw) file name
Before the change

After the change

Permission list: A + sign at the end of the permission, indicating that the permission list is activated

Ii. control of processes and services

1, what's the process
Programs that are running in the system
2. How to view the process of graphics
Gnome-system-monitor

The information of the process exists proc inside
3. View the process commands
PS default view associated with current environment
A current environment-related process

-A|-E View all the processes

-A all processes in the terminal, but does not contain process information for the environment

x contains all information containing the output terminal and must contain the device

F Viewing the dependencies of a process

Everyone of the U-process

PS Ax-o Comm,nice,%cpu,%mem,pid,user,group,stat

PS Ax--sort=%cpu Positive order, plus one--that's reverse.
Positive order

Reverse

4. Priority level
Process status
S Process State
s This process is a top-level process
T indicates that the process is paused
High priority for < processes
N-Process Priority low
L process has lock space in memory

Renice-n-5 PID Modify the priority of the process
Before modification

After modification

Nice-n-5 Command & Assign priority to open a process

5, the process before and after the call
Jobs View All programs placed in the background

BG Serial number will specify the process to run in the background

FG Jobnum Returning the specified process to the foreground

Ctril+z will occupy the terminal process into the background

Ctril+c the end of the process that consumes the terminal
Before stopping


After stopping


6. Signal
1 The process does not stop reloading the configuration
2 Purging process in-memory data
3 clearing the mouse's in-memory data

After killing, the mouse will not be visible, as long as the mouse move, the mouse will appear
9 forced end of process, cannot be blocked
Before the end

After the end

15 Normal End Process
Before the end

After the end

18 running a normal stop process
19 suspend process, cannot be blocked

20 suspend process, can be blocked

There are some other signals, find yourself.
Kill signal PID End specified process
Killall signal process name end process with all process names
7, the control of the service
Name of the Systemctl service
Systemctl Start Open

Systemctl stop
Before stopping

After stopping

Systemctl Status Display state

Systemctl Restart Restart

Systemctl Enable Boot from

Systemctl Disable boot not starting from

Systemctl list-units View the status of all services

SYSTEMCTL list-unit-files list Service boot status

Systemctl list-dependences Viewing the dependencies of a service

Systemctl Mask Freeze Service
Before freezing

After freezing

Systemctl unmask Unlocking Service

Systemctl set-default multi-user.target Start-up graphics

Systemctl Set-default Graphical.target Power-on does not turn on graphics
Do not open before

After opening

8. SSHD Application
SSH [email protected] Log on to the person's computer
Last view who landed on my computer
W See who is using
W-f who is using
PS AUX|GREPPTS/1
Lastb See who landed on my computer, didn't log on

Discussion on the control of authority management, process and service under Linux system

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.