{"id":631,"date":"2016-09-11T12:10:39","date_gmt":"2016-09-11T12:10:39","guid":{"rendered":"https:\/\/peloo.net\/?p=631"},"modified":"2016-09-11T16:36:56","modified_gmt":"2016-09-11T16:36:56","slug":"linux%e6%9f%a5%e7%9c%8b%e6%96%87%e4%bb%b6%e5%b1%9e%e6%80%a7%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/peloo.net\/?p=631","title":{"rendered":"Linux\u67e5\u770b\u6587\u4ef6\u5c5e\u6027\u7684\u51e0\u79cd\u65b9\u6cd5"},"content":{"rendered":"<p>\n\t&nbsp;&nbsp;&nbsp; Linux\u4e0b\u67e5\u770b\u6587\u4ef6\u5c5e\u6027\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u4e14\u8fd9\u4e9b\u65b9\u6cd5\u4e2d\u504f\u5411\u4e0d\u540c\uff0c\u5177\u4f53\u5982\u4e0b\uff1a\n<\/p>\n<p>\n\t&nbsp;\n<\/p>\n<p>\n\t<strong><span style=\"color: #ff0000\">1&nbsp; ls<\/span><\/strong>\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp; ls -a \u67e5\u770b\u6240\u6709\u6587\u4ef6\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp; ls -l \u67e5\u770b\u8be6\u7ec6\u7684\u5c5e\u6027\n<\/p>\n<p>\n\t&nbsp; &nbsp;&nbsp; [pc@li1209-91 ~]$ ls -a ; ls -l<br \/>\n\t. .. bak .bash_history .bash_logout .bash_profile .bashrc .lesshst .lftp lujiaz .ssh .viminfo wordpress wp-ueditor<br \/>\n\ttotal 16<br \/>\n\tdrwxrwxr-x 3 pc pc 4096 Sep 10 12:37 bak<br \/>\n\tdrwxr-xr-x 4 nginx root 4096 Jul 7 20:30 lujiaz<br \/>\n\tdrwxr-xr-x 5 pc pc 4096 Sep 8 01:41 wordpress<br \/>\n\tdrwxr-xr-x 3 root root 4096 Sep 11 11:57 wp-ueditor\n<\/p>\n<p>\n\t<span style=\"color: #ff0000\"><strong>2&nbsp; lsattr<\/strong><\/span>\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp; \u67e5\u770b\u6587\u4ef6\u7684\u6269\u5c55\u5c5e\u6027,\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp; \u5982\u679c\u6587\u4ef6\u88ab\u3000chattr +i&nbsp;&nbsp; \u6dfb\u52a0\u4e86\u5199\u4fdd\u62a4,\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp; \u7528lsattr\u53ef\u4ee5\u770b\u5230\u6dfb\u52a0\u7684\u5c5e\u6027\n<\/p>\n<p>\n\t[pc@li1209-91 ~]$ chattr +i test ; lsattr test<br \/>\n\tchattr: Operation not permitted while setting flags on test<br \/>\n\t-------------e- test\n<\/p>\n<p>\n\t<span style=\"color: #ff0000\"><strong>3&nbsp; file<\/strong><\/span>\n<\/p>\n<p>\n\t\u67e5\u770b\u6587\u4ef6\u7684\u7c7b\u578b\n<\/p>\n<p>\n\t[pc@li1209-91 ~]$ file test<br \/>\n\ttest: empty<br \/>\n\t[pc@li1209-91 ~]$ file \/bin\/bash<br \/>\n\t\/bin\/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU\/Linux 2.6.18, stripped<br \/>\n\t[pc@li1209-91 ~]$ file \/etc\/init.d\/mysqld<br \/>\n\t\/etc\/init.d\/mysqld: POSIX shell script text executable\n<\/p>\n<p>\n\t<strong><span style=\"color: #ff0000\">4&nbsp; stat<\/span><\/strong>\n<\/p>\n<p>\n\t&nbsp;&nbsp;&nbsp; \u67e5\u770b\u6587\u4ef6\u7684\u72b6\u6001\n<\/p>\n<p>\n\t[pc@li1209-91 ~]$ stat \/bin\/bash<br \/>\n\tFile: `\/bin\/bash&#039;<br \/>\n\tSize: 904872 Blocks: 1768 IO Block: 4096 regular file<br \/>\n\tDevice: 800h\/2048d Inode: 8633 Links: 1<br \/>\n\tAccess: (0755\/-rwxr-xr-x) Uid: ( 0\/ root) Gid: ( 0\/ root)<br \/>\n\tAccess: 2014-10-16 21:56:16.000000000 +0800<br \/>\n\tModify: 2014-10-16 21:56:16.000000000 +0800<br \/>\n\tChange: 2015-06-27 13:47:59.661899649 +0800\n<\/p>\n<p>\n\t[pc@li1209-91 ~]$ stat \/etc\/init.d\/mysqld<br \/>\n\tFile: `\/etc\/init.d\/mysqld&#039;<br \/>\n\tSize: 10880 Blocks: 24 IO Block: 4096 regular file<br \/>\n\tDevice: 800h\/2048d Inode: 868388 Links: 1<br \/>\n\tAccess: (0755\/-rwxr-xr-x) Uid: ( 0\/ root) Gid: ( 0\/ root)<br \/>\n\tAccess: 2016-03-13 21:37:29.528864937 +0800<br \/>\n\tModify: 2016-03-13 21:37:29.528864937 +0800<br \/>\n\tChange: 2016-03-13 21:37:50.231529030 +0800<br \/>\n\t[pc@li1209-91 ~]$\n<\/p>\n<p>\n\t[pc@li1209-91 ~]$ stat test<br \/>\n\tFile: `test&#039;<br \/>\n\tSize: 0 Blocks: 0 IO Block: 4096 regular empty file<br \/>\n\tDevice: 800h\/2048d Inode: 155987 Links: 1<br \/>\n\tAccess: (0664\/-rw-rw-r--) Uid: ( 500\/ pc) Gid: ( 501\/ pc)<br \/>\n\tAccess: 2016-09-11 20:01:34.781427826 +0800<br \/>\n\tModify: 2016-09-11 20:01:34.781427826 +0800<br \/>\n\tChange: 2016-09-11 20:01:34.781427826 +0800\n<\/p>\n<p>\n\t<span style=\"color: #ff0000\"><strong>5&nbsp; getfacl<\/strong><\/span>\n<\/p>\n<p>\n\t\u67e5\u770b\u6587\u4ef6\u6743\u9650\n<\/p>\n<p>\n\t[pc@li1209-91 ~]$ getfacl test<br \/>\n\t# file: test<br \/>\n\t# owner: pc<br \/>\n\t# group: pc<br \/>\n\tuser::rw-<br \/>\n\tuser:root:r-x<br \/>\n\tgroup::rw-<br \/>\n\tmask::rwx<br \/>\n\tother::r--[pc@li1209-91 ~]$\n<\/p>\n<p>\n\t[pc@li1209-91 ~]$ getfacl \/bin\/bash<br \/>\n\tgetfacl: Removing leading &#039;\/&#039; from absolute path names<br \/>\n\t# file: bin\/bash<br \/>\n\t# owner: root<br \/>\n\t# group: root<br \/>\n\tuser::rwx<br \/>\n\tgroup::r-x<br \/>\n\tother::r-x\n<\/p>\n<p>\n\t[pc@li1209-91 ~]$ getfacl \/etc\/init.d\/mysqld<br \/>\n\tgetfacl: Removing leading &#039;\/&#039; from absolute path names<br \/>\n\t# file: etc\/init.d\/mysqld<br \/>\n\t# owner: root<br \/>\n\t# group: root<br \/>\n\tuser::rwx<br \/>\n\tgroup::r-x<br \/>\n\tother::r-x<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;&nbsp;&nbsp; Linux\u4e0b\u67e5\u770b\u6587\u4ef6\u5c5e\u6027\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u4e14\u8fd9\u4e9b\u65b9\u6cd5\u4e2d\u504f\u5411\u4e0d\u540c\uff0c\u5177\u4f53\u5982\u4e0b\uff1a &nbsp; 1&nbsp; ls &nbsp;&nbsp;&nbsp; ls -a \u67e5\u770b\u6240\u6709\u6587\u4ef6 &nbsp;&nbsp;&nbsp; ls -l \u67e5\u770b\u8be6\u7ec6\u7684\u5c5e\u6027 &nbsp; &nbsp;&nbsp; [pc@li1209-91 ~]$ ls -a ; ls -l . .. bak .bash_history .bash_logout .bash_profile .bashrc .lesshst .lftp lujiaz .ssh .viminfo wordpress wp-ueditor total 16 drwxrwxr-x 3 pc pc 4096 Sep 10 12:37 bak drwxr-xr-x 4 nginx root 4096 Jul 7 20:30&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-631","post","type-post","status-publish","format-standard","hentry","category-linux"],"aioseo_notices":[],"brizy_media":[],"_links":{"self":[{"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/posts\/631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/peloo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=631"}],"version-history":[{"count":8,"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/posts\/631\/revisions"}],"predecessor-version":[{"id":665,"href":"https:\/\/peloo.net\/index.php?rest_route=\/wp\/v2\/posts\/631\/revisions\/665"}],"wp:attachment":[{"href":"https:\/\/peloo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peloo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peloo.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}