File system access list (FACL) and user and Linux endpoints

Source: Internet
Author: User

Facl:filesystem Access Control List

Save additional access control permissions with file extensions

Tom

Tom,tom Basic Group

jerry:other:r--


Chown: Only Administrators have permission

jerry:rw-


Setfacl

-M: Set, attach

U:uid:perm (permissions)

G:gid:perm

-X: Cancel

U:uid

G:gid

Getfacl


Several commands:

W

W.H.O.

Exercise: Check to see if Hadoop is logged in every 5 seconds, such as logging in, showing that it is logged in, and launching

Sleep



WhoAmI

Last xianshi/var/log/wtmp file, showing 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 #:

Lastlog: The last logon time per user of the current system

-u username: Displays the most recent login information for the specified user

BaseName

$: Script path and name when executing script

Mail

Hostname: Displays host name or Echo $HOSTNAME


If the host name of the current host is empty, or (none), or localhost, change it to www.baidu.com

[-Z ' hostname '] | | [' hostname ' = = ' (none) '-o ' hostname ' = = ' localhost '] && hostname www.baidu.com


Generate random numbers

random:0-32768 Echo $RANDOM


Write a script that uses random to generate 10 random numbers and find out its maximum, and minimum value

#!/bin/bash

#

Declare-i max=0

Declare-i min=0


For I in {1..10}; Do

Myrandom= $RANDOM

[$I-eq 1] && min= $MYRANDOM

If [$I-le 9]; Then

Echo-n "$MYRANDOM,"

Else

echo "$MYRANDOM"

Fi

[$MYRANDOM-gt $MAX] && max= $MYRANDOM

[$MYRANDOM-lt $MIN] && min= $MYRANDOM

Done

Echo $MAX

Echo $MIN


Random number generator:

/dev/random

/dev/urandom


Terminal type

Console: Consoles

Pty: Physical Terminal

TTY: Virtual Console

TTYs: Serial Terminal

pts/#: Pseudo Terminal


This article is from "Wilson's IT Career" blog, be sure to keep this source http://wilson20.blog.51cto.com/8385324/1426628

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.