Little white Python Road Linux section 10/28&29

Source: Internet
Author: User

RWX permissions of other people in the main group on files

1.userdel Delete things are not complete, there will be residues,

completely delete [[email protected] ~]# Userdel-r Tom
single delete [[email protected] ~]# Rm-rf/var/spool/mail/tom
The corresponding numeric value r=4 w=2 x=1, then rwx=7

#1 Create a directory,[[Email protected] ~]#cd/tmp/View permissions [[email protected] tmp]#ll-d/tmp/DRWXRWXRWT. 8192 root root October 13:41/tmp/create file [[email protected] tmp]#mkdir/testView permissions [[email protected] tmp]#ll-dl/testdrwxrwxrwx 4 root root 43 October 29 12:37/Test[[email protected] tmp]#cd/test[[email protected] test]#Touch A.txt[[email protected] test]#ll A.txt-rw-r--r--1 root root 0 October 29 13:47A.txt Create a regular user [[email protected] test]#useradd Tom[[email protected] test]#Su-tomLast Login: Day October 13:18:49 CST 2017pts/0 on [[email protected]~]$ CD/Test View file [[email protected] test]$ lsa.txt test1 Tom#4[email protected] test]$ cat A.txt#(no content)#6[ email protected] test]$ cat a.txt (readable) [[email protected] test]$ echo'Tom'>>a.txt (writable)#8[email protected] test]$ cat a.txt-bash:./a.txt: Insufficient Authority# One[[email protected] test]$./a.txt (executable)

#2 super users[email protected] ~]$ Su-root password: Last login: Day October13:00:00 CST 2017PTS/1on [[email protected]~]#echo ' root11111 ' > A.txt[[Email protected] ~]#chmod o=-A.txt (Other people have permission of 0)[[Email protected] ~]#ll A.txt-RWXR-----1 root root 10 October 29 13:49a.txt#5.[[Email protected] ~]#chmod o=r a.txt#7[[Email protected] ~]#chmod o=w a.txt#9[[Email protected] ~]#Cat A.txtroot11111#Ten[[Email protected] ~]#chmod o=rx a.txt# A[[Email protected] ~]#vim a.txt (added LS passwd)[[Email protected] ~]#./a.txtAnaconda-ks.cfg a.txt initial-setup-ks.cfg jack.txt Change the password of the user root. New Password: invalid password: Password not provided re-enter new password: Password not provided passwd: Authentication token operation error [[email protected]~]#[[Email protected] ~]# 

Usermod-g Target group name User name----------Add this user to the target group

Permission can be added minus eg:chmod u-r a.txt

U-g-O

R U-r G-r

X

W

rwx permissions of the genus Master Group on the directory

#1 Creating a user[[Email protected] ~]#useradd Alex#3Exit[[email protected]~]#Su-alex[[email protected] Alex]#ls/test/test1/jack1.txt jack2.txt#5[[email protected] Alex]#cd/test/test1/[[email protected] test1]#Cd/test/test1[[email protected] test1]#pwd/test/test17[[email protected] test1]#lsjack1.txt jack2.txt9[[email protected] test1]#Exitlog out [[email protected] test]$ su-Alex[[email protected] test]$ CD/test/test111[email protected] test]$ RM-rf/test/test1/Jack1.txt13[[email protected] test]$ ls/test/test1jack1.txt jack2.txt[[email protected] test]$ touch/test/test/Tom.txt15[[email protected] test1] $CD/test/Test1[[email protected] test1]$ Ls[[email protected] test1]$ touch/test/test117[[email protected] test1]$ Exit[[email protected] test]#Cd/test/test1[[email protected] test1]#Touch/test/test1[[email protected] test1]#lsjack1.txt Jack2.txt[[email protected] test1]#RM-RF jack2.txt[[email protected] test1]#ll A.txt

2[[Email protected]~]$ mkdir/test/Test1[[email protected]~]$ touch/test/test1/Jack1.txt[[email protected]~]$ touch/test/test1/Jack2.txt[[email protected]~]$ Exit[[email protected]~]#ll-d/text/text1/[[Email protected] ~]#chmod o-x/test/test1/4[[email protected] ~]#chmod o-x/test/test1/6[[email protected] ~]#chmod o=rx/test/test1/8[[email protected] ~]#chmod o=r/test/test1/10[[Email protected]~]#Cd/test/test1[[email protected] test1]#ll[[email protected] test1]#chmod 777 *[[email protected] test1]#llTotal dosage 0-RWXRWXRWX 1 Jack Jack 0 October 29 14:39Jack1.txt-RWXRWXRWX 1 Jack Jack 0 October 29 14:39Jack2.txt[[email protected] test1]#ll-d/test/test1/bash:ll-d: no command found ... [[email protected] test1]#llTotal dosage 0-RWXRWXRWX 1 Jack Jack 0 October 29 14:39Jack1.txt-RWXRWXRWX 1 Jack Jack 0 October 29 14:39Jack2.txt[[email protected] test1]#ll-d/test/test1drwxrwxr--2 Jack Jack 40 October 14:39/test/Test1[[email protected] test1]#chmod o+x/test/test112[[email protected] test1]#lsjack1.txt jack2.txt14[[email protected] test1]#lsjack1.txt Jack2.txt[[email protected] test1]#Ll.tom.txt[[email protected] test1]#[[email protected] test1]#ll-d/test/test1Drwxrwxr-x 2 Jack Jack 23 October 15:08/test/Test1[[email protected] test1]#chmod o=-/test/test1[[email protected] test1]#ll-d/test/test1DRWXRWX---2 jack Jack 23 October 15:08/test/test116[[email protected] test1]#usermod-g Jack Alex .[[email protected] test1]#ID Jack\uid=1206 (Jack) gid=1206 (Jack) group =1206 (Jack)

Add:

4-R Read Cat CD

2-w Write Echo

1-x execution.

Cat View File Contents

Chmod-w-------------give other groups of users permission to write to a file

chmod o=------------Remove Read permissions for other group users

Chmod o=r-------------give Read permissions to other groups of users

echo Add File Contents

./Ah, txt indicates the command parameter (must have x permission) to execute the file

EG:CHOMD O=rx A.txt

Little white Python Road Linux section 10/28&29

Related Article

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.