"Linux_ Notes" linux_ File system access Control List (FACL), users, and Linux endpoints

Source: Internet
Author: User

Learning resources from: www.magedu.com

Mistakes are unavoidable in the learning process, and if found, they are also pointed out by the great gods.

Some of the sample operations are related to historical operations, and if the previous example operation has not been performed, there may be some examples of operations that cannot be performed. Examples are for reference only (exercises are in the appendix).



File system access control List

File system access Control List (FACL): Filesystem access Controls List
Save additional access control permissions with file extensions

Setfacl (set Facl)
-M: Set
U:uid:perm
G:gid:perm
To set a default access control list for a directory:
D:u:uid:perm
D:g:gid:perm
-X: Cancel
U:uid
G:gid

Getfacl (get Facl)


Example: (using Facl to give the user the read and write access to the file Inittab created by the root of Hadoop)
Mkdir/backup
Cd/backup
Cp/etc/inittab./
Getfacl Inittab

Su-hadoop
Cd/backup
Ls
Echo 123 > inittab--refuses to execute
Exit

Setfacl-m U:HADOOP:RW inittab--To set additional access rights for Inittab
Getfacl Inittab

Su-hadoop
Cd/backup
Echo 123 >> inittab--Successful execution
Tail-5 Inittab
Exit

Setfacl-m G:MYGROUP:RW inittab--Set group permissions
Getfacl Inittab

Setfacl-x u:hadoop inittab--Cancel Permissions
Setfacl-x G:mygroup Inittab
Getfacl Inittab



Permission Application order:
When there is no facl:----and Group--and other
With Facl after:----facl,user----and-facl--and other


Terminal type:
Console: Control console directly attached to the monitor on the host, keyboard (hardware and software that can verify the user's identity)
Pty: Physical Terminal (VGA)
tty#: Part # Virtual Console (VGA)
ttys#: # serial Terminal
pts/#: Part # pseudo Terminal

several commands:

W:Shows what and what commands are being executed by the user who is logged on to the current system

Who :Shows which users are logged on to the current system (user, terminal, time)
-R: Displays the current run level
-H: Displays the table header;
W.H.O. | grep "Hadoop"--see if Hadoop is signed in

Sleep:Process delay
Sleep 5--every 5 seconds

WhoAmI:Show valid users currently logged on to the system

Last :Displays the/var/log/wtmp file showing the user login history and System restart history
-N #: Displays information about recent # times

LASTB:/var/log/btmp file that displays user error login attempts
-N #: Displays information about recent # times

Lastlog:
Displays the last successful login information for each user;
-U USERNAME: Displays recent login information for a specific user

basename:Gets the base name of the path
$: Script path and name when executing script (reference script name)
Example:
basename/etc/passwd

Mail:Mail
Enter a number to view a message
Q: Exit
Example: (Send mail)
Cat/etc/fstab | Mail-s "How is You" root
Mail-s "How is" root </etc/fstab

hostname:Get host name in real time
hostname hostname:Renaming
echo $HOSTNAME:Get host name (not real-time)
Example:
If the host name of the current host is not www.magedu.com, change it to www.magedu.com
[' hostname '! = www.magedu.com] && hostname www.magedu.com

If the host name of the current host is localhost, change it to www.magedu.com
[' hostname '! = localhost] && hostname www.magedu.com

If the host name of the current host is empty, or (none), change it to www.magedu.com
[-Z ' hostname '] | | [' hostname ' = = ' (none) '] && hostname www.magedu.com
-Z (host name is empty)

Generate random numbers


RANDOM (System internal command): 0-32768--regular
Echo $RANDOM

Random number generator (irregular): Entropy pool
/dev/random:
/dev/urandom:





This article from "Not Daze" blog, please make sure to keep this source http://tobeys.blog.51cto.com/10620284/1689976

"Linux_ Notes" linux_ File system access Control List (FACL), users, and Linux endpoints

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.