码迷,mamicode.com
首页 > 其他好文 > 详细

特殊权限练习

时间:2016-01-03 02:39:40      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:

[root@localhost ~]# useradd stu
[root@localhost ~]# su stu
[stu@localhost root]$ cat /etc/shadow
cat: /etc/shadow: 权限不够
[stu@localhost root]$ exit
exit
[root@localhost ~]# cat /etc/shadow
root:$1$hDJWFMdl$hfgaq.eQ1pWrODJV7jQmn1:16330:0:99999:7:::
bin:*:16325:0:99999:7:::
daemon:*:16325:0:99999:7:::
adm:*:16325:0:99999:7:::
lp:*:16325:0:99999:7:::
sync:*:16325:0:99999:7:::
shutdown:*:16325:0:99999:7:::
halt:*:16325:0:99999:7:::
mail:*:16325:0:99999:7:::
news:*:16325:0:99999:7:::
uucp:*:16325:0:99999:7:::
operator:*:16325:0:99999:7:::
games:*:16325:0:99999:7:::
gopher:*:16325:0:99999:7:::
ftp:*:16325:0:99999:7:::
nobody:*:16325:0:99999:7:::
nscd:!!:16325:0:99999:7:::
vcsa:!!:16325:0:99999:7:::
rpc:!!:16325:0:99999:7:::
mailnull:!!:16325:0:99999:7:::
smmsp:!!:16325:0:99999:7:::
pcap:!!:16325:0:99999:7:::
dbus:!!:16325:0:99999:7:::
avahi:!!:16325:0:99999:7:::
sshd:!!:16325:0:99999:7:::
rpcuser:!!:16325:0:99999:7:::
nfsnobody:!!:16325:0:99999:7:::
haldaemon:!!:16325:0:99999:7:::
avahi-autoipd:!!:16325:0:99999:7:::
xfs:!!:16325:0:99999:7:::
stu:!!:16357:0:99999:7:::
[root@localhost ~]# ls -l /etc/shadow
-r-------- 1 root root 889 10-14 18:55 /etc/shadow
[root@localhost ~]# sl -l /usr/bin/passwd
-bash: sl: command not found
[root@localhost ~]# ls -l /usr/bin/passwd
-rwsr-xr-x 1 root root 19904 2007-01-07 /usr/bin/passwd
[root@localhost ~]# ls -l /usr/bin/locate
-rwx--s--x 1 root slocate 22280 2009-09-04 /usr/bin/locate
[root@localhost ~]# ll /tmp
总计 0
[root@localhost ~]# ls -ld /tmp
drwxrwxrwt 4 root root 4096 10-14 18:36 /tmp
[root@localhost ~]# cd /tmp
[root@localhost tmp]# touch test
[root@localhost tmp]# ll
总计 4
-rw-r--r-- 1 root root 0 10-14 19:21 test
[root@localhost tmp]# chmod 777 test
[root@localhost tmp]# ll
总计 4
-rwxrwxrwx 1 root root 0 10-14 19:21 test
[root@localhost tmp]# su stu
[stu@localhost tmp]$ ll
总计 4
-rwxrwxrwx 1 root root 0 10-14 19:21 test
[stu@localhost tmp]$ rm test
rm: 无法删除 “test”: 不允许的操作
[stu@localhost tmp]$ exit
exit
[root@localhost tmp]# ll
总计 4
-rwxrwxrwx 1 root root 0 10-14 19:21 test
[root@localhost tmp]# rm test
rm:是否删除 一般空文件 “test”? y
[root@localhost tmp]# ll
总计 0
[root@localhost tmp]# su stu
[stu@localhost tmp]$ touch test1
[stu@localhost tmp]$ chmod 777 test1
[stu@localhost tmp]$ ll
总计 4
-rwxrwxrwx 1 stu stu 0 10-14 19:23 test1
[stu@localhost tmp]$ exit
exit
[root@localhost tmp]# useradd stu2
[root@localhost tmp]# su stu2
[stu2@localhost tmp]$ ll
总计 4
-rwxrwxrwx 1 stu stu 0 10-14 19:23 test1
[stu2@localhost tmp]$ rm test1
rm: 无法删除 “test1”: 不允许的操作
[stu2@localhost tmp]$ exit
exit
[root@localhost tmp]# ll
总计 4
-rwxrwxrwx 1 stu stu 0 10-14 19:23 test1
[root@localhost tmp]# rm test1
rm:是否删除 一般空文件 “test1”? y
[root@localhost tmp]# ll
总计 0
[root@localhost tmp]# umask
0022
[root@localhost tmp]# touch test
[root@localhost tmp]# ll
总计 4
-rw-r--r-- 1 root root 0 10-14 19:30 test
[root@localhost tmp]# chmod 4755 test;ll test
-rwsr-xr-x 1 root root 0 10-14 19:30 test
[root@localhost tmp]# chmod 6755 test;ll test
-rwsr-sr-x 1 root root 0 10-14 19:30 test
[root@localhost tmp]# chmod 1755 test;ll test
-rwxr-xr-t 1 root root 0 10-14 19:30 test
[root@localhost tmp]# chmod 7666 test;ll test
-rwSrwSrwT 1 root root 0 10-14 19:30 test
[root@localhost tmp]#

 

特殊权限练习

标签:

原文地址:http://www.cnblogs.com/cphome/p/5095693.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!