{"id":52142,"date":"2024-12-03T12:19:01","date_gmt":"2024-12-03T04:19:01","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52142\/"},"modified":"2024-12-03T12:19:01","modified_gmt":"2024-12-03T04:19:01","slug":"linux%e5%a6%82%e4%bd%95%e6%9f%a5%e7%9c%8b%e6%89%80%e6%9c%89%e7%94%a8%e6%88%b7","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52142\/","title":{"rendered":"linux\u5982\u4f55\u67e5\u770b\u6240\u6709\u7528\u6237"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>linux\u5982\u4f55\u67e5\u770b\u6240\u6709\u7528\u6237<\/h1>\n<p>\u600e\u4e48\u5165\u95e8\u6587\u7ae0\u7f16\u7a0b\uff1f\u9700\u8981\u5b66\u4e60\u54ea\u4e9b\u77e5\u8bc6\u70b9\uff1f\u8fd9\u662f\u65b0\u624b\u4eec\u521a\u63a5\u89e6\u7f16\u7a0b\u65f6\u5e38\u89c1\u7684\u95ee\u9898\uff1b\u4e0b\u9762\u7c73\u4e91\u5c31\u6765\u7ed9\u5927\u5bb6\u6574\u7406\u5206\u4eab\u4e00\u4e9b\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u80fd\u591f\u7ed9\u521d\u5b66\u8005\u4e00\u4e9b\u5e2e\u52a9\u3002\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u4ecb\u7ecd\u300alinux\u5982\u4f55\u67e5\u770b\u6240\u6709\u7528\u6237\u300b\uff0c\u6d89\u53ca\u5230\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u6536\u85cf\u4e00\u4e0b<\/p>\n<\/p>\n<blockquote>\n<p>linux\u67e5\u770b\u6240\u6709\u7528\u6237\u7684\u65b9\u6cd5\uff1a1\u3001\u4f7f\u7528cat\u7b49\u6587\u4ef6\u64cd\u4f5c\u547d\u4ee4\u8bfb\u53d6\u201c\/etc\/passwd\u201d\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u53ef\u6253\u5370Linux\u7cfb\u7edf\u4e0a\u521b\u5efa\u7684\u7528\u6237\u5217\u8868\u30022\u3001\u4f7f\u7528getent\u547d\u4ee4\u67e5\u770b\uff0c\u8bed\u6cd5\u201cgetent passwd\u201d\uff0c\u53ef\u4ee5\u663e\u793a\u7c7b\u4f3c\u4e8e\u201c\/etc\/passwd\u201d\u6587\u4ef6\u7684\u7528\u6237\u8be6\u7ec6\u4fe1\u606f\u30023\u3001\u4f7f\u7528compgen\u547d\u4ee4\uff0c\u8bed\u6cd5\u201ccompgen -u\u201d\u3002<\/p>\n<\/blockquote>\n<p>\u5927\u5bb6\u90fd\u77e5\u9053\uff0cLinux \u7cfb\u7edf\u4e2d\u7528\u6237\u4fe1\u606f\u5b58\u653e\u5728 \/etc\/passwd \u6587\u4ef6\u4e2d\u3002<\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u5305\u542b\u6bcf\u4e2a\u7528\u6237\u57fa\u672c\u4fe1\u606f\u7684\u6587\u672c\u6587\u4ef6\u3002\u5f53\u6211\u4eec\u5728\u7cfb\u7edf\u4e2d\u521b\u5efa\u4e00\u4e2a\u7528\u6237\uff0c\u65b0\u7528\u6237\u7684\u8be6\u7ec6\u4fe1\u606f\u5c31\u4f1a\u88ab\u6dfb\u52a0\u5230\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>\/etc\/passwd \u6587\u4ef6\u5c06\u6bcf\u4e2a\u7528\u6237\u7684\u57fa\u672c\u4fe1\u606f\u8bb0\u5f55\u4e3a\u6587\u4ef6\u4e2d\u7684\u4e00\u884c\uff0c\u4e00\u884c\u4e2d\u5305\u542b 7 \u4e2a\u5b57\u6bb5\u3002<\/p>\n<p>\/etc\/passwd \u6587\u4ef6\u7684\u4e00\u884c\u4ee3\u8868\u4e00\u4e2a\u5355\u72ec\u7684\u7528\u6237\u3002\u8be5\u6587\u4ef6\u5c06\u7528\u6237\u7684\u4fe1\u606f\u5206\u4e3a 3 \u4e2a\u90e8\u5206\u3002<\/p>\n<pre>*&nbsp;\u7b2c&nbsp;1&nbsp;\u90e8\u5206\uff1a`root`&nbsp;\u7528\u6237\u4fe1\u606f\n*&nbsp;\u7b2c&nbsp;2&nbsp;\u90e8\u5206\uff1a\u7cfb\u7edf\u5b9a\u4e49\u7684\u8d26\u53f7\u4fe1\u606f\n*&nbsp;\u7b2c&nbsp;3&nbsp;\u90e8\u5206\uff1a\u771f\u5b9e\u7528\u6237\u7684\u8d26\u6237\u4fe1\u606f<\/pre>\n<p>\u7b2c\u4e00\u90e8\u5206\u662f root \u8d26\u6237\uff0c\u8fd9\u4ee3\u8868\u7ba1\u7406\u5458\u8d26\u6237\uff0c\u5bf9\u7cfb\u7edf\u7684\u6bcf\u4e2a\u65b9\u9762\u90fd\u6709\u5b8c\u5168\u7684\u6743\u529b\u3002<\/p>\n<p>\u7b2c\u4e8c\u90e8\u5206\u662f\u7cfb\u7edf\u5b9a\u4e49\u7684\u7fa4\u7ec4\u548c\u8d26\u6237\uff0c\u8fd9\u4e9b\u7fa4\u7ec4\u548c\u8d26\u53f7\u662f\u6b63\u786e\u5b89\u88c5\u548c\u66f4\u65b0\u7cfb\u7edf\u8f6f\u4ef6\u6240\u5fc5\u9700\u7684\u3002<\/p>\n<p>\u7b2c\u4e09\u90e8\u5206\u5728\u6700\u540e\uff0c\u4ee3\u8868\u4e00\u4e2a\u4f7f\u7528\u7cfb\u7edf\u7684\u771f\u5b9e\u7528\u6237\u3002<\/p>\n<p>\u5728\u521b\u5efa\u65b0\u7528\u6237\u65f6\uff0c\u5c06\u4fee\u6539\u4ee5\u4e0b 4 \u4e2a\u6587\u4ef6\u3002<\/p>\n<pre>*&nbsp;`\/etc\/passwd`\uff1a&nbsp;\u7528\u6237\u8d26\u6237\u7684\u8be6\u7ec6\u4fe1\u606f\u5728\u6b64\u6587\u4ef6\u4e2d\u66f4\u65b0\u3002\n*&nbsp;`\/etc\/shadow`\uff1a&nbsp;\u7528\u6237\u8d26\u6237\u5bc6\u7801\u5728\u6b64\u6587\u4ef6\u4e2d\u66f4\u65b0\u3002\n*&nbsp;`\/etc\/group`\uff1a&nbsp;\u65b0\u7528\u6237\u7fa4\u7ec4\u7684\u8be6\u7ec6\u4fe1\u606f\u5728\u6b64\u6587\u4ef6\u4e2d\u66f4\u65b0\u3002\n*&nbsp;`\/etc\/gshadow`\uff1a&nbsp;\u65b0\u7528\u6237\u7fa4\u7ec4\u5bc6\u7801\u5728\u6b64\u6587\u4ef6\u4e2d\u66f4\u65b0\u3002<\/pre>\n<p><strong>\u65b9\u6cd5 1 \uff1a\u4f7f\u7528 <code>\/etc\/passwd<\/code> \u6587\u4ef6<\/strong><\/p>\n<p>\u4f7f\u7528\u4efb\u4f55\u4e00\u4e2a\u50cf cat\u3001more\u3001less \u7b49\u6587\u4ef6\u64cd\u4f5c\u547d\u4ee4\u6765\u6253\u5370 Linux \u7cfb\u7edf\u4e0a\u521b\u5efa\u7684\u7528\u6237\u5217\u8868\u3002<\/p>\n<p>\/etc\/passwd \u662f\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u767b\u5f55 Linux \u7cfb\u7edf\u6240\u5fc5\u9700\u7684\u6bcf\u4e2a\u7528\u6237\u7684\u4fe1\u606f\u3002\u5b83\u4fdd\u5b58\u7528\u6237\u7684\u6709\u7528\u4fe1\u606f\uff0c\u5982\u7528\u6237\u540d\u3001\u5bc6\u7801\u3001\u7528\u6237 ID\u3001\u7fa4\u7ec4 ID\u3001\u7528\u6237 ID \u4fe1\u606f\u3001\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u548c Shell \u3002<\/p>\n<p>\/etc\/passwd \u6587\u4ef6\u5c06\u6bcf\u4e2a\u7528\u6237\u7684\u8be6\u7ec6\u4fe1\u606f\u5199\u4e3a\u4e00\u884c\uff0c\u5176\u4e2d\u5305\u542b\u4e03\u4e2a\u5b57\u6bb5\uff0c\u6bcf\u4e2a\u5b57\u6bb5\u4e4b\u95f4\u7528\u5192\u53f7 : \u5206\u9694\uff1a<\/p>\n<pre>#&nbsp;cat&nbsp;\/etc\/passwd\nroot:x:0:0:root:\/root:\/bin\/bash\nbin:x:1:1:bin:\/bin:\/sbin\/nologin\ndaemon:x:2:2:daemon:\/sbin:\/sbin\/nologin\nadm:x:3:4:adm:\/var\/adm:\/sbin\/nologin\nlp:x:4:7:lp:\/var\/spool\/lpd:\/sbin\/nologin\nsync:x:5:0:sync:\/sbin:\/bin\/sync\nshutdown:x:6:0:shutdown:\/sbin:\/sbin\/shutdown\nhalt:x:7:0:halt:\/sbin:\/sbin\/halt\nmail:x:8:12:mail:\/var\/spool\/mail:\/sbin\/nologin\nftp:x:14:50:FTP&nbsp;User:\/var\/ftp:\/sbin\/nologin\npostfix:x:89:89::\/var\/spool\/postfix:\/sbin\/nologin\nsshd:x:74:74:Privilege-separated&nbsp;SSH:\/var\/empty\/sshd:\/sbin\/nologin\ntcpdump:x:72:72::\/:\/sbin\/nologin\n2gadmin:x:500:10::\/home\/viadmin:\/bin\/bash\napache:x:48:48:Apache:\/var\/www:\/sbin\/nologin\nzabbix:x:498:499:Zabbix&nbsp;Monitoring&nbsp;System:\/var\/lib\/zabbix:\/sbin\/nologin\nmysql:x:497:502::\/home\/mysql:\/bin\/bash\nzend:x:502:503::\/u01\/zend\/zend\/gui\/lighttpd:\/sbin\/nologin\nrpc:x:32:32:Rpcbind&nbsp;Daemon:\/var\/cache\/rpcbind:\/sbin\/nologin\n2daygeek:x:503:504::\/home\/2daygeek:\/bin\/bash\nnamed:x:25:25:Named:\/var\/named:\/sbin\/nologin\nmageshm:x:506:507:2g&nbsp;Admin&nbsp;-&nbsp;Magesh&nbsp;M:\/home\/mageshm:\/bin\/bash<\/pre>\n<p>7 \u4e2a\u5b57\u6bb5\u7684\u8be6\u7ec6\u4fe1\u606f\u5982\u4e0b\u3002<\/p>\n<ul>\n<li>\n<p><strong>\u7528\u6237\u540d<\/strong> \uff08magesh\uff09\uff1a \u5df2\u521b\u5efa\u7528\u6237\u7684\u7528\u6237\u540d\uff0c\u5b57\u7b26\u957f\u5ea6 1 \u4e2a\u5230 12 \u4e2a\u5b57\u7b26\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5bc6\u7801<\/strong>\uff08x\uff09\uff1a\u4ee3\u8868\u52a0\u5bc6\u5bc6\u7801\u4fdd\u5b58\u5728 `\/etc\/shadow \u6587\u4ef6\u4e2d\u3002<\/p>\n<\/li>\n<li>\n<p>**\u7528\u6237 ID\uff08506\uff09\uff1a\u4ee3\u8868\u7528\u6237\u7684 ID \u53f7\uff0c\u6bcf\u4e2a\u7528\u6237\u90fd\u8981\u6709\u4e00\u4e2a\u552f\u4e00\u7684 ID \u3002UID \u53f7\u4e3a 0 \u7684\u662f\u4e3a root \u7528\u6237\u4fdd\u7559\u7684\uff0cUID \u53f7 1 \u5230 99 \u662f\u4e3a\u7cfb\u7edf\u7528\u6237\u4fdd\u7559\u7684\uff0cUID \u53f7 100-999 \u662f\u4e3a\u7cfb\u7edf\u8d26\u6237\u548c\u7fa4\u7ec4\u4fdd\u7559\u7684\u3002<\/p>\n<\/li>\n<li>\n<p>**\u7fa4\u7ec4 ID \uff08507\uff09\uff1a\u4ee3\u8868\u7fa4\u7ec4\u7684 ID \u53f7\uff0c\u6bcf\u4e2a\u7fa4\u7ec4\u90fd\u8981\u6709\u4e00\u4e2a\u552f\u4e00\u7684 GID \uff0c\u4fdd\u5b58\u5728 \/etc\/group\u6587\u4ef6\u4e2d\u3002<\/p>\n<\/li>\n<li>\n<p>**\u7528\u6237\u4fe1\u606f\uff082g Admin &#8211; Magesh M\uff09\uff1a\u4ee3\u8868\u63cf\u8ff0\u5b57\u6bb5\uff0c\u53ef\u4ee5\u7528\u6765\u63cf\u8ff0\u7528\u6237\u7684\u4fe1\u606f\uff08LCTT \u8bd1\u6ce8\uff1a\u6b64\u5904\u539f\u6587\u7591\u6709\u8bef\uff09\u3002<\/p>\n<\/li>\n<li>\n<p>**\u5bb6\u76ee\u5f55\uff08\/home\/mageshm\uff09\uff1a\u4ee3\u8868\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u3002<\/p>\n<\/li>\n<li>\n<p>**Shell\uff08\/bin\/bash\uff09\uff1a\u4ee3\u8868\u7528\u6237\u4f7f\u7528\u7684 shell \u7c7b\u578b\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528 awk \u6216 cut \u547d\u4ee4\u4ec5\u6253\u5370\u51fa Linux \u7cfb\u7edf\u4e2d\u6240\u6709\u7528\u6237\u7684\u7528\u6237\u540d\u5217\u8868\u3002\u663e\u793a\u7684\u7ed3\u679c\u662f\u76f8\u540c\u7684\u3002<\/p>\n<pre>#&nbsp;awk&nbsp;-F':'&nbsp;'{&nbsp;print&nbsp;$1}'&nbsp;\/etc\/passwd\nor\n#&nbsp;cut&nbsp;-d:&nbsp;-f1&nbsp;\/etc\/passwd\nroot\nbin\ndaemon\nadm\nlp\nsync\nshutdown\nhalt\nmail\nftp\npostfix\nsshd\ntcpdump\n2gadmin\napache\nzabbix\nmysql\nzend\nrpc\n2daygeek\nnamed\nmageshm<\/pre>\n<p><strong>\u65b9\u6cd5 2 \uff1a\u4f7f\u7528 <code>getent<\/code> \u547d\u4ee4<\/strong><\/p>\n<p>getent \u547d\u4ee4\u663e\u793a Name Service Switch \u5e93\u652f\u6301\u7684\u6570\u636e\u5e93\u4e2d\u7684\u6761\u76ee\u3002\u8fd9\u4e9b\u5e93\u7684\u914d\u7f6e\u6587\u4ef6\u4e3a \/etc\/nsswitch.conf\u3002<\/p>\n<p>getent \u547d\u4ee4\u663e\u793a\u7c7b\u4f3c\u4e8e \/etc\/passwd \u6587\u4ef6\u7684\u7528\u6237\u8be6\u7ec6\u4fe1\u606f\uff0c\u5b83\u5c06\u6bcf\u4e2a\u7528\u6237\u8be6\u7ec6\u4fe1\u606f\u663e\u793a\u4e3a\u5305\u542b\u4e03\u4e2a\u5b57\u6bb5\u7684\u5355\u884c\u3002<\/p>\n<pre>#&nbsp;getent&nbsp;passwd\nroot:x:0:0:root:\/root:\/bin\/bash\nbin:x:1:1:bin:\/bin:\/sbin\/nologin\ndaemon:x:2:2:daemon:\/sbin:\/sbin\/nologin\nadm:x:3:4:adm:\/var\/adm:\/sbin\/nologin\nlp:x:4:7:lp:\/var\/spool\/lpd:\/sbin\/nologin\nsync:x:5:0:sync:\/sbin:\/bin\/sync\nshutdown:x:6:0:shutdown:\/sbin:\/sbin\/shutdown\nhalt:x:7:0:halt:\/sbin:\/sbin\/halt\nmail:x:8:12:mail:\/var\/spool\/mail:\/sbin\/nologin\nftp:x:14:50:FTP&nbsp;User:\/var\/ftp:\/sbin\/nologin\npostfix:x:89:89::\/var\/spool\/postfix:\/sbin\/nologin\nsshd:x:74:74:Privilege-separated&nbsp;SSH:\/var\/empty\/sshd:\/sbin\/nologin\ntcpdump:x:72:72::\/:\/sbin\/nologin\n2gadmin:x:500:10::\/home\/viadmin:\/bin\/bash\napache:x:48:48:Apache:\/var\/www:\/sbin\/nologin\nzabbix:x:498:499:Zabbix&nbsp;Monitoring&nbsp;System:\/var\/lib\/zabbix:\/sbin\/nologin\nmysql:x:497:502::\/home\/mysql:\/bin\/bash\nzend:x:502:503::\/u01\/zend\/zend\/gui\/lighttpd:\/sbin\/nologin\nrpc:x:32:32:Rpcbind&nbsp;Daemon:\/var\/cache\/rpcbind:\/sbin\/nologin\n2daygeek:x:503:504::\/home\/2daygeek:\/bin\/bash\nnamed:x:25:25:Named:\/var\/named:\/sbin\/nologin\nmageshm:x:506:507:2g&nbsp;Admin&nbsp;-&nbsp;Magesh&nbsp;M:\/home\/mageshm:\/bin\/bash<\/pre>\n<p>7 \u4e2a\u5b57\u6bb5\u7684\u8be6\u7ec6\u4fe1\u606f\u5982\u4e0a\u6240\u8ff0\u3002\uff08LCTT \u8bd1\u6ce8\uff1a\u6b64\u5904\u5185\u5bb9\u91cd\u590d\uff0c\u5220\u8282\uff09<\/p>\n<p>\u4f60\u540c\u6837\u53ef\u4ee5\u4f7f\u7528 awk \u6216 cut \u547d\u4ee4\u4ec5\u6253\u5370\u51fa Linux \u7cfb\u7edf\u4e2d\u6240\u6709\u7528\u6237\u7684\u7528\u6237\u540d\u5217\u8868\u3002\u663e\u793a\u7684\u7ed3\u679c\u662f\u76f8\u540c\u7684\u3002<\/p>\n<p><strong>\u65b9\u6cd5 3 \uff1a\u4f7f\u7528 <code>compgen<\/code> \u547d\u4ee4<\/strong><\/p>\n<p>compgen \u662f bash \u7684\u5185\u7f6e\u547d\u4ee4\uff0c\u5b83\u5c06\u663e\u793a\u6240\u6709\u53ef\u7528\u7684\u547d\u4ee4\uff0c\u522b\u540d\u548c\u51fd\u6570\u3002<\/p>\n<pre>#&nbsp;compgen&nbsp;-u\nroot\nbin\ndaemon\nadm\nlp\nsync\nshutdown\nhalt\nmail\nftp\npostfix\nsshd\ntcpdump\n2gadmin\napache\nzabbix\nmysql\nzend\nrpc\n2daygeek\nnamed\nmageshm<\/pre>\n<p>\u672c\u7bc7\u5173\u4e8e\u300alinux\u5982\u4f55\u67e5\u770b\u6240\u6709\u7528\u6237\u300b\u7684\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\u5566\uff0c\u4f46\u662f\u5b66\u65e0\u6b62\u5883\uff0c\u60f3\u8981\u4e86\u89e3\u5b66\u4e60\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>linux\u5982\u4f55\u67e5\u770b\u6240\u6709\u7528\u6237 \u600e\u4e48\u5165\u95e8\u6587\u7ae0\u7f16\u7a0b\uff1f\u9700\u8981\u5b66\u4e60\u54ea\u4e9b\u77e5\u8bc6\u70b9\uff1f\u8fd9\u662f\u65b0\u624b\u4eec\u521a\u63a5\u89e6\u7f16\u7a0b\u65f6\u5e38\u89c1\u7684\u95ee\u9898\uff1b\u4e0b\u9762\u7c73\u4e91\u5c31\u6765\u7ed9\u5927\u5bb6\u6574\u7406\u5206\u4eab\u4e00\u4e9b\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u80fd\u591f\u7ed9\u521d\u5b66\u8005\u4e00\u4e9b\u5e2e\u52a9\u3002\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u4ecb\u7ecd\u300alinux\u5982\u4f55\u67e5\u770b\u6240\u6709\u7528\u6237\u300b\uff0c\u6d89\u53ca\u5230\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u6536\u85cf\u4e00\u4e0b linux\u67e5\u770b\u6240\u6709\u7528\u6237\u7684\u65b9\u6cd5\uff1a1\u3001\u4f7f\u7528cat\u7b49\u6587\u4ef6\u64cd\u4f5c\u547d\u4ee4\u8bfb\u53d6\u201c\/etc\/passwd\u201d\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u53ef\u6253\u5370Linux\u7cfb\u7edf\u4e0a\u521b\u5efa\u7684\u7528\u6237\u5217\u8868\u30022\u3001\u4f7f\u7528getent\u547d\u4ee4\u67e5\u770b\uff0c\u8bed\u6cd5\u201cgetent passwd\u201d\uff0c\u53ef\u4ee5\u663e\u793a\u7c7b\u4f3c\u4e8e\u201c\/etc\/passwd\u201d\u6587\u4ef6\u7684\u7528\u6237\u8be6\u7ec6\u4fe1\u606f\u30023\u3001\u4f7f\u7528compgen\u547d\u4ee4\uff0c\u8bed\u6cd5\u201ccompgen -u\u201d\u3002 \u5927\u5bb6\u90fd\u77e5\u9053\uff0cLinux \u7cfb\u7edf\u4e2d\u7528\u6237\u4fe1\u606f\u5b58\u653e\u5728 \/etc\/passwd \u6587\u4ef6\u4e2d\u3002 \u8fd9\u662f\u4e00\u4e2a\u5305\u542b\u6bcf\u4e2a\u7528\u6237\u57fa\u672c\u4fe1\u606f\u7684\u6587\u672c\u6587\u4ef6\u3002\u5f53\u6211\u4eec\u5728\u7cfb\u7edf\u4e2d\u521b\u5efa\u4e00\u4e2a\u7528\u6237\uff0c\u65b0\u7528\u6237\u7684\u8be6\u7ec6\u4fe1\u606f\u5c31\u4f1a\u88ab\u6dfb\u52a0\u5230\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u3002 \/etc\/passwd \u6587\u4ef6\u5c06\u6bcf\u4e2a\u7528\u6237\u7684\u57fa\u672c\u4fe1\u606f\u8bb0\u5f55\u4e3a\u6587\u4ef6\u4e2d\u7684\u4e00\u884c\uff0c\u4e00\u884c\u4e2d\u5305\u542b 7 \u4e2a\u5b57\u6bb5\u3002 \/etc\/passwd \u6587\u4ef6\u7684\u4e00\u884c\u4ee3\u8868\u4e00\u4e2a\u5355\u72ec\u7684\u7528\u6237\u3002\u8be5\u6587\u4ef6\u5c06\u7528\u6237\u7684\u4fe1\u606f\u5206\u4e3a 3 \u4e2a\u90e8\u5206\u3002 *&nbsp;\u7b2c&nbsp;1&nbsp;\u90e8\u5206\uff1a`root`&nbsp;\u7528\u6237\u4fe1\u606f *&nbsp;\u7b2c&nbsp;2&nbsp;\u90e8\u5206\uff1a\u7cfb\u7edf\u5b9a\u4e49\u7684\u8d26\u53f7\u4fe1\u606f *&nbsp;\u7b2c&nbsp;3&nbsp;\u90e8\u5206\uff1a\u771f\u5b9e\u7528\u6237\u7684\u8d26\u6237\u4fe1\u606f \u7b2c\u4e00\u90e8\u5206\u662f root \u8d26\u6237\uff0c\u8fd9\u4ee3\u8868\u7ba1\u7406\u5458\u8d26\u6237\uff0c\u5bf9\u7cfb\u7edf\u7684\u6bcf\u4e2a\u65b9\u9762\u90fd\u6709\u5b8c\u5168\u7684\u6743\u529b\u3002 \u7b2c\u4e8c\u90e8\u5206\u662f\u7cfb\u7edf\u5b9a\u4e49\u7684\u7fa4\u7ec4\u548c\u8d26\u6237\uff0c\u8fd9\u4e9b\u7fa4\u7ec4\u548c\u8d26\u53f7\u662f\u6b63\u786e\u5b89\u88c5\u548c\u66f4\u65b0\u7cfb\u7edf\u8f6f\u4ef6\u6240\u5fc5\u9700\u7684\u3002 \u7b2c\u4e09\u90e8\u5206\u5728\u6700\u540e\uff0c\u4ee3\u8868\u4e00\u4e2a\u4f7f\u7528\u7cfb\u7edf\u7684\u771f\u5b9e\u7528\u6237\u3002 \u5728\u521b\u5efa\u65b0\u7528\u6237\u65f6\uff0c\u5c06\u4fee\u6539\u4ee5\u4e0b 4 \u4e2a\u6587\u4ef6\u3002 *&nbsp;`\/etc\/passwd`\uff1a&nbsp;\u7528\u6237\u8d26\u6237\u7684\u8be6\u7ec6\u4fe1\u606f\u5728\u6b64\u6587\u4ef6\u4e2d\u66f4\u65b0\u3002 *&nbsp;`\/etc\/shadow`\uff1a&nbsp;\u7528\u6237\u8d26\u6237\u5bc6\u7801\u5728\u6b64\u6587\u4ef6\u4e2d\u66f4\u65b0\u3002 *&nbsp;`\/etc\/group`\uff1a&nbsp;\u65b0\u7528\u6237\u7fa4\u7ec4\u7684\u8be6\u7ec6\u4fe1\u606f\u5728\u6b64\u6587\u4ef6\u4e2d\u66f4\u65b0\u3002 *&nbsp;`\/etc\/gshadow`\uff1a&nbsp;\u65b0\u7528\u6237\u7fa4\u7ec4\u5bc6\u7801\u5728\u6b64\u6587\u4ef6\u4e2d\u66f4\u65b0\u3002 \u65b9\u6cd5 1 \uff1a\u4f7f\u7528 \/etc\/passwd \u6587\u4ef6 \u4f7f\u7528\u4efb\u4f55\u4e00\u4e2a\u50cf cat\u3001more\u3001less \u7b49\u6587\u4ef6\u64cd\u4f5c\u547d\u4ee4\u6765\u6253\u5370 Linux \u7cfb\u7edf\u4e0a\u521b\u5efa\u7684\u7528\u6237\u5217\u8868\u3002 \/etc\/passwd \u662f\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u767b\u5f55 Linux \u7cfb\u7edf\u6240\u5fc5\u9700\u7684\u6bcf\u4e2a\u7528\u6237\u7684\u4fe1\u606f\u3002\u5b83\u4fdd\u5b58\u7528\u6237\u7684\u6709\u7528\u4fe1\u606f\uff0c\u5982\u7528\u6237\u540d\u3001\u5bc6\u7801\u3001\u7528\u6237 ID\u3001\u7fa4\u7ec4 ID\u3001\u7528\u6237 ID \u4fe1\u606f\u3001\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u548c Shell \u3002 \/etc\/passwd \u6587\u4ef6\u5c06\u6bcf\u4e2a\u7528\u6237\u7684\u8be6\u7ec6\u4fe1\u606f\u5199\u4e3a\u4e00\u884c\uff0c\u5176\u4e2d\u5305\u542b\u4e03\u4e2a\u5b57\u6bb5\uff0c\u6bcf\u4e2a\u5b57\u6bb5\u4e4b\u95f4\u7528\u5192\u53f7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-52142","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=52142"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52142\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}