{"id":242,"date":"2022-07-04T10:22:14","date_gmt":"2022-07-04T02:22:14","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=242"},"modified":"2022-07-04T16:57:37","modified_gmt":"2022-07-04T08:57:37","slug":"chapter-05","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/chapter-05.html","title":{"rendered":"\u7b2c5\u7ae0 \u7528\u6237\u8eab\u4efd\u4e0e\u6587\u4ef6\u6743\u9650\u3002"},"content":{"rendered":"
👇\u672c\u7ae0\u8282\u5185\u5bb9\u5df2\u66f4\u65b0\uff0c\u8bf7\u5728\u7ebf\u9605\u8bfb\u6700\u65b0RHEL 8\u7248\u672c\u4e66\u7c4d 👇<\/span><\/strong><\/span><\/p>\n https:\/\/lrxjmw.cn\/basic-learning-05.html<\/span><\/strong><\/span><\/b><\/p>\n \u7ae0\u8282\u7b80\u8ff0\uff1a<\/strong><\/span><\/p>\n Linux\u662f\u4e00\u4e2a\u591a\u7528\u6237\u3001\u591a\u4efb\u52a1\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5177\u6709\u5f88\u597d\u7684\u7a33\u5b9a\u6027\u4e0e\u5b89\u5168\u6027\uff0c\u5728\u5e55\u540e\u4fdd\u969cLinux\u7cfb\u7edf<\/a>\u5b89\u5168\u7684\u5219\u662f\u4e00\u7cfb\u5217\u590d\u6742\u7684\u914d\u7f6e\u5de5\u4f5c\u3002\u672c\u7ae0\u5c06\u8be6\u7ec6\u8bb2\u89e3\u6587\u4ef6\u7684\u6240\u6709\u8005\u3001\u6240\u5c5e\u7ec4\u4ee5\u53ca\u5176\u4ed6\u4eba\u53ef\u5bf9\u6587\u4ef6\u8fdb\u884c\u7684\u8bfb\uff08r\uff09\u3001\u5199\uff08w\uff09\u3001\u6267\u884c\uff08x\uff09\u7b49\u64cd\u4f5c\uff0c\u4ee5\u53ca\u5982\u4f55\u5728Linux\u7cfb\u7edf\u4e2d\u6dfb\u52a0\u3001\u5220\u9664\u3001\u4fee\u6539\u7528\u6237\u8d26\u6237\u4fe1\u606f\u3002\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528SUID\u3001SGID\u4e0eSBIT\u7279\u6b8a\u6743\u9650\u66f4\u52a0\u7075\u6d3b\u5730\u8bbe\u7f6e\u7cfb\u7edf\u6743\u9650\u529f\u80fd\uff0c\u6765\u5f25\u8865\u5bf9\u6587\u4ef6\u8bbe\u7f6e\u4e00\u822c\u64cd\u4f5c\u6743\u9650\u65f6\u6240\u5e26\u6765\u7684\u4e0d\u8db3\u3002\u9690\u85cf\u6743\u9650\u80fd\u591f\u7ed9\u7cfb\u7edf\u589e\u52a0\u4e00\u5c42\u9690\u5f62\u7684\u9632\u62a4\u5c42\uff0c\u8ba9\u9ed1\u5ba2\u6700\u591a\u53ea\u80fd\u67e5\u770b\u5173\u952e\u65e5\u5fd7\u4fe1\u606f\uff0c\u800c\u4e0d\u80fd\u8fdb\u884c\u4fee\u6539\u6216\u5220\u9664\u3002\u800c\u6587\u4ef6\u7684\u8bbf\u95ee\u63a7\u5236\u5217\u8868\uff08Access Control List\uff0cACL\uff09\u53ef\u4ee5\u8fdb\u4e00\u6b65\u8ba9\u5355\u4e00\u7528\u6237\u3001\u7528\u6237\u7ec4\u5bf9\u5355\u4e00\u6587\u4ef6\u6216\u76ee\u5f55\u8fdb\u884c\u7279\u6b8a\u7684\u6743\u9650\u8bbe\u7f6e\uff0c\u8ba9\u6587\u4ef6\u5177\u6709\u80fd\u6ee1\u8db3\u5de5\u4f5c\u9700\u6c42\u7684\u6700\u5c0f\u6743\u9650\u3002\u672c\u7ae0\u6700\u540e\u8fd8\u5c06\u8bb2\u89e3\u5982\u4f55\u4f7f\u7528su\u547d\u4ee4\u4e0esudo\u670d\u52a1\u8ba9\u666e\u901a\u7528\u6237\u5177\u5907\u7ba1\u7406\u5458\u7684\u6743\u9650\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u6ee1\u8db3\u65e5\u5e38\u7684\u5de5\u4f5c\u9700\u6c42\uff0c\u8fd8\u53ef\u4ee5\u786e\u4fdd\u7cfb\u7edf\u7684\u5b89\u5168\u6027\u3002<\/p>\n \u8bbe\u8ba1Linux\u7cfb\u7edf\u7684\u521d\u8877\u4e4b\u4e00\u5c31\u662f\u4e3a\u4e86\u6ee1\u8db3\u591a\u4e2a\u7528\u6237\u540c\u65f6\u5de5\u4f5c\u7684\u9700\u6c42\uff0c\u56e0\u6b64Linux\u7cfb\u7edf\u5fc5\u987b\u5177\u5907\u5f88\u597d\u7684\u5b89\u5168\u6027\u3002\u7b2c1\u7ae0\u5728\u5b89\u88c5RHEL 7\u64cd\u4f5c\u7cfb\u7edf\u65f6\uff0c\u7279\u522b\u8981\u6c42\u8bbe\u7f6eroot\u7ba1\u7406\u5458\u5bc6\u7801\uff0c\u8fd9\u4e2aroot\u7ba1\u7406\u5458\u5c31\u662f\u5b58\u5728\u4e8e\u6240\u6709\u7c7bUNIX\u7cfb\u7edf\u4e2d\u7684\u8d85\u7ea7\u7528\u6237\u3002\u5b83\u62e5\u6709\u6700\u9ad8\u7684\u7cfb\u7edf\u6240\u6709\u6743\uff0c\u80fd\u591f\u7ba1\u7406\u7cfb\u7edf\u7684\u5404\u9879\u529f\u80fd\uff0c\u5982\u6dfb\u52a0\/\u5220\u9664\u7528\u6237\u3001\u542f\u52a8\/\u5173\u95ed\u670d\u52a1\u8fdb\u7a0b\u3001\u5f00\u542f\/\u7981\u7528\u786c\u4ef6\u8bbe\u5907\u7b49\u3002\u867d\u7136\u4ee5root\u7ba1\u7406\u5458\u7684\u8eab\u4efd\u5de5\u4f5c\u65f6\u4e0d\u4f1a\u53d7\u5230\u7cfb\u7edf\u7684\u9650\u5236\uff0c\u4f46\u4fd7\u8bed\u8bb2\u201c\u80fd\u529b\u8d8a\u5927\uff0c\u8d23\u4efb\u5c31\u8d8a\u5927\u201d\uff0c\u56e0\u6b64\u4e00\u65e6\u4f7f\u7528\u8fd9\u4e2a\u9ad8\u80fd\u7684root\u7ba1\u7406\u5458\u6743\u9650\u6267\u884c\u4e86\u9519\u8bef\u7684\u547d\u4ee4\u53ef\u80fd\u4f1a\u76f4\u63a5\u6bc1\u6389\u6574\u4e2a\u7cfb\u7edf\u3002\u4f7f\u7528\u4e0e\u5426\uff0c\u786e\u5b9e\u9700\u8981\u597d\u597d\u6743\u8861\u4e00\u4e0b\u3002<\/p>\n \u5728\u5b66\u4e60\u65f6\u662f\u5426\u8981\u4f7f\u7528root\u7ba1\u7406\u5458\u6743\u9650\u6765\u63a7\u5236\u6574\u4e2a\u7cfb\u7edf\u5462\uff1f\u9762\u5bf9\u8fd9\u4e2a\u95ee\u9898\uff0c\u7f51\u7edc\u4e0a\u6709\u5f88\u591a\u6587\u7ae0\u5efa\u8bae\u4ee5\u666e\u901a\u7528\u6237\u7684\u8eab\u4efd\u6765\u64cd\u4f5c\u2014\u8fd9\u662f\u4e00\u4e2a\u66f4\u5b89\u5168\u4e5f\u66f4\u201c\u65e0\u8d23\u4efb\u201d\u7684\u56de\u7b54\u3002\u4eca\u5929\uff0c\u5218\u9044\u8001\u5e08\u5c31\u8981\u5192\u5929\u4e0b\u4e4b\u5927\u4e0d\u97ea\u7ed9\u51fa\u81ea\u5df1\u7684\u5fc3\u5f97\u2014\u5f3a\u70c8\u63a8\u8350\u5927\u5bb6\u5728\u5b66\u4e60\u65f6\u4f7f\u7528root\u7ba1\u7406\u5458\u6743\u9650\uff01<\/p>\n \u8fd9\u79cd\u4e3aroot\u7ba1\u7406\u5458\u6b63\u540d\u7684\u51b3\u7edd\u6001\u5ea6\u5728\u7f51\u7edc\u4e2d\u5e94\u8be5\u8fd8\u662f\u5f88\u5c11\u89c1\u7684\uff0c\u6211\u4e4b\u6240\u4ee5\u529b\u8350root\u7ba1\u7406\u5458\u6743\u9650\uff0c\u539f\u56e0\u5f88\u7b80\u5355\u3002\u56e0\u4e3a\u5728Linux\u7684\u5b66\u4e60\u8fc7\u7a0b\u4e2d\u5982\u679c\u4f7f\u7528\u666e\u901a\u7528\u6237\u8eab\u4efd\u8fdb\u884c\u64cd\u4f5c\uff0c\u5219\u5728\u914d\u7f6e\u670d\u52a1\u4e4b\u540e\u51fa\u73b0\u9519\u8bef\u65f6\u5f88\u96be\u5224\u65ad\u662f\u7cfb\u7edf\u81ea\u8eab\u7684\u95ee\u9898\u8fd8\u662f\u56e0\u4e3a\u6743\u9650\u4e0d\u8db3\u800c\u5bfc\u81f4\u7684\uff1b\u8fd9\u65e0\u7591\u4f1a\u7ed9\u5927\u5bb6\u7684\u5b66\u4e60\u8fc7\u7a0b\u5f92\u589e\u574e\u5777\u3002\u66f4\u4f55\u51b5\u6211\u4eec\u7684\u5b9e\u9a8c\u73af\u5883\u662f\u4f7f\u7528VMware\u865a\u62df\u673a\u8f6f\u4ef6\u642d\u5efa\u7684\uff0c\u53ef\u4ee5\u5c06\u5b89\u88c5\u597d\u7684\u7cfb\u7edf\u8bbe\u7f6e\u4e3a\u4e00\u6b21\u5feb\u7167\uff0c\u8fd9\u5373\u4fbf\u7cfb\u7edf\u5f7b\u5e95\u5d29\u6e83\u4e86\uff0c\u60a8\u4e5f\u53ef\u4ee5\u57285\u79d2\u949f\u7684\u65f6\u95f4\u5185\u5feb\u901f\u8fd8\u539f\u51fa\u4e00\u53f0\u5168\u65b0\u7684\u7cfb\u7edf\uff0c\u800c\u4e0d\u7528\u62c5\u5fc3\u6570\u636e\u4e22\u5931\u3002<\/p>\n \u603b\u4e4b\uff0c\u5218\u9044\u8001\u5e08\u5728\u57f9\u8bad\u65f6\u90fd\u63a8\u8350\u6bcf\u4f4d\u5b66\u751f\u4f7f\u7528root\u7ba1\u7406\u5458\u6743\u9650\u6765\u5b66\u4e60Linux\u7cfb\u7edf\uff0c\u7b49\u5230\u5de5\u4f5c\u65f6\u518d\u6839\u636e\u751f\u4ea7\u73af\u5883\u51b3\u5b9a\u4f7f\u7528\u54ea\u4e2a\u7528\u6237\u6743\u9650\uff1b\u8fd9\u4e9b\u4ec5\u4e0e\u9009\u62e9\u76f8\u5173\uff0c\u800c\u975e\u6280\u672f\u6027\u95ee\u9898\u3002<\/p>\n \u53e6\u5916\uff0c\u5f88\u591a\u56fe\u4e66\u6216\u57f9\u8bad\u673a\u6784\u7684\u8001\u5e08\u4f1a\u8bb2\u5230\uff0cLinux\u7cfb\u7edf\u4e2d\u7684\u7ba1\u7406\u5458\u5c31\u662froot\u3002\u8fd9\u5176\u5b9e\u662f\u9519\u8bef\u7684\uff0cLinux\u7cfb\u7edf\u7684\u7ba1\u7406\u5458\u4e4b\u6240\u4ee5\u662froot\uff0c\u5e76\u4e0d\u662f\u56e0\u4e3a\u5b83\u7684\u540d\u5b57\u53ebroot\uff0c\u800c\u662f\u56e0\u4e3a\u8be5\u7528\u6237\u7684\u8eab\u4efd\u53f7\u7801\u5373UID\uff08User IDentification\uff09\u7684\u6570\u503c\u4e3a0\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0cUID\u5c31\u76f8\u5f53\u4e8e\u6211\u4eec\u7684\u8eab\u4efd\u8bc1\u53f7\u7801\u4e00\u6837\u5177\u6709\u552f\u4e00\u6027\uff0c\u56e0\u6b64\u53ef\u901a\u8fc7\u7528\u6237\u7684UID\u503c\u6765\u5224\u65ad\u7528\u6237\u8eab\u4efd\u3002\u5728RHEL 7\u7cfb\u7edf\u4e2d\uff0c\u7528\u6237\u8eab\u4efd\u6709\u4e0b\u9762\u8fd9\u4e9b\u3002<\/p>\n \u7ba1\u7406\u5458UID\u4e3a0\uff1a\u7cfb\u7edf\u7684\u7ba1\u7406\u5458\u7528\u6237\u3002<\/p>\n \u7cfb\u7edf\u7528\u6237UID\u4e3a1\uff5e999\uff1a Linux\u7cfb\u7edf\u4e3a\u4e86\u907f\u514d\u56e0\u67d0\u4e2a\u670d\u52a1\u7a0b\u5e8f\u51fa\u73b0\u6f0f\u6d1e\u800c\u88ab\u9ed1\u5ba2\u63d0\u6743\u81f3\u6574\u53f0\u670d\u52a1\u5668\uff0c\u9ed8\u8ba4\u670d\u52a1\u7a0b\u5e8f\u4f1a\u6709\u72ec\u7acb\u7684\u7cfb\u7edf\u7528\u6237\u8d1f\u8d23\u8fd0\u884c\uff0c\u8fdb\u800c\u6709\u6548\u63a7\u5236\u88ab\u7834\u574f\u8303\u56f4\u3002<\/p>\n \u666e\u901a\u7528\u6237UID\u4ece1000\u5f00\u59cb\uff1a\u662f\u7531\u7ba1\u7406\u5458\u521b\u5efa\u7684\u7528\u4e8e\u65e5\u5e38\u5de5\u4f5c\u7684\u7528\u6237\u3002<\/p><\/blockquote>\n \u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cUID\u662f\u4e0d\u80fd\u51b2\u7a81\u7684\uff0c\u800c\u4e14\u7ba1\u7406\u5458\u521b\u5efa\u7684\u666e\u901a\u7528\u6237\u7684UID\u9ed8\u8ba4\u662f\u4ece1000\u5f00\u59cb\u7684\uff08\u5373\u4f7f\u524d\u9762\u6709\u95f2\u7f6e\u7684\u53f7\u7801\uff09\u3002<\/p>\n \u4e3a\u4e86\u65b9\u4fbf\u7ba1\u7406\u5c5e\u4e8e\u540c\u4e00\u7ec4\u7684\u7528\u6237\uff0cLinux\u7cfb\u7edf\u4e2d\u8fd8\u5f15\u5165\u4e86\u7528\u6237\u7ec4\u7684\u6982\u5ff5\u3002\u901a\u8fc7\u4f7f\u7528\u7528\u6237\u7ec4\u53f7\u7801\uff08GID\uff0cGroup IDentification\uff09\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u591a\u4e2a\u7528\u6237\u52a0\u5165\u5230\u540c\u4e00\u4e2a\u7ec4\u4e2d\uff0c\u4ece\u800c\u65b9\u4fbf\u4e3a\u7ec4\u4e2d\u7684\u7528\u6237\u7edf\u4e00\u89c4\u5212\u6743\u9650\u6216\u6307\u5b9a\u4efb\u52a1\u3002\u5047\u8bbe\u6709\u4e00\u4e2a\u516c\u53f8\u4e2d\u6709\u591a\u4e2a\u90e8\u95e8\uff0c\u6bcf\u4e2a\u90e8\u95e8\u4e2d\u53c8\u6709\u5f88\u591a\u5458\u5de5\u3002\u5982\u679c\u53ea\u60f3\u8ba9\u5458\u5de5\u8bbf\u95ee\u672c\u90e8\u95e8\u5185\u7684\u8d44\u6e90\uff0c\u5219\u53ef\u4ee5\u9488\u5bf9\u90e8\u95e8\u800c\u975e\u5177\u4f53\u7684\u5458\u5de5\u6765\u8bbe\u7f6e\u6743\u9650\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u901a\u8fc7\u5bf9\u6280\u672f\u90e8\u95e8\u8bbe\u7f6e\u6743\u9650\uff0c\u4f7f\u5f97\u53ea\u6709\u6280\u672f\u90e8\u95e8\u7684\u5458\u5de5\u53ef\u4ee5\u8bbf\u95ee\u516c\u53f8\u7684\u6570\u636e\u5e93\u4fe1\u606f\u7b49\u3002<\/p>\n \u53e6\u5916\uff0c\u5728Linux\u7cfb\u7edf\u4e2d\u521b\u5efa\u6bcf\u4e2a\u7528\u6237\u65f6\uff0c\u5c06\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a\u4e0e\u5176\u540c\u540d\u7684\u57fa\u672c\u7528\u6237\u7ec4\uff0c\u800c\u4e14\u8fd9\u4e2a\u57fa\u672c\u7528\u6237\u7ec4\u53ea\u6709\u8be5\u7528\u6237\u4e00\u4e2a\u4eba\u3002\u5982\u679c\u8be5\u7528\u6237\u4ee5\u540e\u88ab\u5f52\u7eb3\u5165\u5176\u4ed6\u7528\u6237\u7ec4\uff0c\u5219\u8fd9\u4e2a\u5176\u4ed6\u7528\u6237\u7ec4\u79f0\u4e4b\u4e3a\u6269\u5c55\u7528\u6237\u7ec4\u3002\u4e00\u4e2a\u7528\u6237\u53ea\u6709\u4e00\u4e2a\u57fa\u672c\u7528\u6237\u7ec4\uff0c\u4f46\u662f\u53ef\u4ee5\u6709\u591a\u4e2a\u6269\u5c55\u7528\u6237\u7ec4\uff0c\u4ece\u800c\u6ee1\u8db3\u65e5\u5e38\u7684\u5de5\u4f5c\u9700\u8981\u3002<\/p>\n 1. \u00a0useradd\u547d\u4ee4<\/strong><\/p>\n useradd\u547d\u4ee4\u7528\u4e8e\u521b\u5efa\u65b0\u7684\u7528\u6237\uff0c\u683c\u5f0f\u4e3a\u201cuseradd [\u9009\u9879] \u7528\u6237\u540d\u201d\u3002<\/p>\n \u53ef\u4ee5\u4f7f\u7528useradd\u547d\u4ee4\u521b\u5efa\u7528\u6237\u8d26\u6237\u3002\u4f7f\u7528\u8be5\u547d\u4ee4\u521b\u5efa\u7528\u6237\u8d26\u6237\u65f6\uff0c\u9ed8\u8ba4\u7684\u7528\u6237\u5bb6\u76ee\u5f55\u4f1a\u88ab\u5b58\u653e\u5728\/home\u76ee\u5f55\u4e2d\uff0c\u9ed8\u8ba4\u7684Shell\u89e3\u91ca\u5668\u4e3a\/bin\/bash\uff0c\u800c\u4e14\u9ed8\u8ba4\u4f1a\u521b\u5efa\u4e00\u4e2a\u4e0e\u8be5\u7528\u6237\u540c\u540d\u7684\u57fa\u672c\u7528\u6237\u7ec4\u3002\u8fd9\u4e9b\u9ed8\u8ba4\u8bbe\u7f6e\u53ef\u4ee5\u6839\u636e\u88685-1\u4e2d\u7684useradd\u547d\u4ee4\u53c2\u6570\u81ea\u884c\u4fee\u6539\u3002<\/p>\n \u88685-1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 useradd\u547d\u4ee4\u4e2d\u7684\u7528\u6237\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528<\/p>\n <\/div>\n<\/div>\n \u4e0b\u9762\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u666e\u901a\u7528\u6237\u5e76\u6307\u5b9a\u5bb6\u76ee\u5f55\u7684\u8def\u5f84\u3001\u7528\u6237\u7684UID\u4ee5\u53caShell\u89e3\u91ca\u5668\u3002\u5728\u4e0b\u9762\u7684\u547d\u4ee4\u4e2d\uff0c\u8bf7\u6ce8\u610f\/sbin\/nologin\uff0c\u5b83\u662f\u7ec8\u7aef\u89e3\u91ca\u5668\u4e2d\u7684\u4e00\u5458\uff0c\u4e0eBash\u89e3\u91ca\u5668\u6709\u7740\u5929\u58e4\u4e4b\u522b\u3002\u4e00\u65e6\u7528\u6237\u7684\u89e3\u91ca\u5668\u88ab\u8bbe\u7f6e\u4e3anologin\uff0c\u5219\u4ee3\u8868\u8be5\u7528\u6237\u4e0d\u80fd\u767b\u5f55\u5230\u7cfb\u7edf\u4e2d\uff1a<\/p>\n 2. \u00a0groupadd\u547d\u4ee4<\/strong><\/p>\n groupadd\u547d\u4ee4\u7528\u4e8e\u521b\u5efa\u7528\u6237\u7ec4\uff0c\u683c\u5f0f\u4e3a\u201cgroupadd [\u9009\u9879] \u7fa4\u7ec4\u540d\u201d\u3002<\/p>\n \u4e3a\u4e86\u80fd\u591f\u66f4\u52a0\u9ad8\u6548\u5730\u6307\u6d3e\u7cfb\u7edf\u4e2d\u5404\u4e2a\u7528\u6237\u7684\u6743\u9650\uff0c\u5728\u5de5\u4f5c\u4e2d\u5e38\u5e38\u4f1a\u628a\u51e0\u4e2a\u7528\u6237\u52a0\u5165\u5230\u540c\u4e00\u4e2a\u7ec4\u91cc\u9762\uff0c\u8fd9\u6837\u4fbf\u53ef\u4ee5\u9488\u5bf9\u4e00\u7c7b\u7528\u6237\u7edf\u4e00\u5b89\u6392\u6743\u9650\u3002\u521b\u5efa\u7528\u6237\u7ec4\u7684\u6b65\u9aa4\u975e\u5e38\u7b80\u5355\uff0c\u4f8b\u5982\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u7528\u6237\u7ec4ronny\uff1a<\/p>\n 3. \u00a0usermod\u547d\u4ee4<\/strong><\/p>\n usermod\u547d\u4ee4\u7528\u4e8e\u4fee\u6539\u7528\u6237\u7684\u5c5e\u6027\uff0c\u683c\u5f0f\u4e3a\u201cusermod [\u9009\u9879] \u7528\u6237\u540d\u201d\u3002<\/p>\n \u524d\u6587\u66fe\u53cd\u590d\u5f3a\u8c03\uff0cLinux\u7cfb\u7edf\u4e2d\u7684\u4e00\u5207\u90fd\u662f\u6587\u4ef6\uff0c\u56e0\u6b64\u5728\u7cfb\u7edf\u4e2d\u521b\u5efa\u7528\u6237\u4e5f\u5c31\u662f\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u7684\u8fc7\u7a0b\u3002\u7528\u6237\u7684\u4fe1\u606f\u4fdd\u5b58\u5728\/etc\/passwd\u6587\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u76f4\u63a5\u7528\u6587\u672c\u7f16\u8f91\u5668\u6765\u4fee\u6539\u5176\u4e2d\u7684\u7528\u6237\u53c2\u6570\u9879\u76ee\uff0c\u4e5f\u53ef\u4ee5\u7528usermod\u547d\u4ee4\u4fee\u6539\u5df2\u7ecf\u521b\u5efa\u7684\u7528\u6237\u4fe1\u606f\uff0c\u8bf8\u5982\u7528\u6237\u7684UID\u3001\u57fa\u672c\/\u6269\u5c55\u7528\u6237\u7ec4\u3001\u9ed8\u8ba4\u7ec8\u7aef\u7b49\u3002usermod\u547d\u4ee4\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528\u5982\u88685-2\u6240\u793a\u3002<\/p>\n \u88685-2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 usermod\u547d\u4ee4\u4e2d\u7684\u53c2\u6570\u53ca\u4f5c\u7528<\/p>\n <\/p>\n \u5927\u5bb6\u4e0d\u8981\u88ab\u8fd9\u4e48\u591a\u53c2\u6570\u5413\u574f\u4e86\u3002\u6211\u4eec\u5148\u6765\u770b\u4e00\u4e0b\u8d26\u6237linuxprobe\u7684\u9ed8\u8ba4\u4fe1\u606f\uff1a<\/p>\n \u7136\u540e\u5c06\u7528\u6237linuxprobe\u52a0\u5165\u5230root\u7528\u6237\u7ec4\u4e2d\uff0c\u8fd9\u6837\u6269\u5c55\u7ec4\u5217\u8868\u4e2d\u5219\u4f1a\u51fa\u73b0root\u7528\u6237\u7ec4\u7684\u5b57\u6837\uff0c\u800c\u57fa\u672c\u7ec4\u4e0d\u4f1a\u53d7\u5230\u5f71\u54cd\uff1a<\/p>\n \u518d\u6765\u8bd5\u8bd5\u7528-u\u53c2\u6570\u4fee\u6539linuxprobe\u7528\u6237\u7684UID\u53f7\u7801\u503c\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u7528-g\u53c2\u6570\u4fee\u6539\u7528\u6237\u7684\u57fa\u672c\u7ec4ID\uff0c\u7528-G\u53c2\u6570\u4fee\u6539\u7528\u6237\u6269\u5c55\u7ec4ID\u3002<\/p>\n 4. \u00a0passwd\u547d\u4ee4<\/strong><\/p>\n passwd\u547d\u4ee4\u7528\u4e8e\u4fee\u6539\u7528\u6237\u5bc6\u7801\u3001\u8fc7\u671f\u65f6\u95f4\u3001\u8ba4\u8bc1\u4fe1\u606f\u7b49\uff0c\u683c\u5f0f\u4e3a\u201cpasswd [\u9009\u9879] [\u7528\u6237\u540d]\u201d\u3002<\/p>\n \u666e\u901a\u7528\u6237\u53ea\u80fd\u4f7f\u7528passwd\u547d\u4ee4\u4fee\u6539\u81ea\u8eab\u7684\u7cfb\u7edf\u5bc6\u7801\uff0c\u800croot\u7ba1\u7406\u5458\u5219\u6709\u6743\u9650\u4fee\u6539\u5176\u4ed6\u6240\u6709\u4eba\u7684\u5bc6\u7801\u3002\u66f4\u9177\u7684\u662f\uff0croot\u7ba1\u7406\u5458\u5728Linux\u7cfb\u7edf\u4e2d\u4fee\u6539\u81ea\u5df1\u6216\u4ed6\u4eba\u7684\u5bc6\u7801\u65f6\u4e0d\u9700\u8981\u9a8c\u8bc1\u65e7\u5bc6\u7801\uff0c\u8fd9\u4e00\u70b9\u7279\u522b\u65b9\u4fbf\u3002\u65e2\u7136root\u7ba1\u7406\u5458\u53ef\u4ee5\u4fee\u6539\u5176\u4ed6\u7528\u6237\u7684\u5bc6\u7801\uff0c\u5c31\u8868\u793a\u5b8c\u5168\u62e5\u6709\u8be5\u7528\u6237\u7684\u7ba1\u7406\u6743\u9650\u3002passwd\u547d\u4ee4\u4e2d\u53ef\u7528\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528\u5982\u88685-3\u6240\u793a\u3002<\/p>\n \u88685-3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 passwd\u547d\u4ee4\u4e2d\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528<\/p>\n <\/div>\n \u63a5\u4e0b\u6765\u5218\u9044\u8001\u5e08\u5c06\u6f14\u793a\u5982\u4f55\u4fee\u6539\u7528\u6237\u81ea\u5df1\u7684\u5bc6\u7801\uff0c\u4ee5\u53ca\u5982\u4f55\u4fee\u6539\u5176\u4ed6\u4eba\u7684\u5bc6\u7801\uff08\u4fee\u6539\u4ed6\u4eba\u5bc6\u7801\u65f6\uff0c\u9700\u8981\u5177\u6709root\u7ba1\u7406\u5458\u6743\u9650\uff09\uff1a<\/p>\n \u5047\u8bbe\u60a8\u6709\u4f4d\u540c\u4e8b\u6b63\u5728\u5ea6\u5047\uff0c\u800c\u4e14\u5047\u671f\u5f88\u957f\uff0c\u90a3\u4e48\u53ef\u4ee5\u4f7f\u7528passwd\u547d\u4ee4\u7981\u6b62\u8be5\u7528\u6237\u767b\u5f55\u7cfb\u7edf\uff0c\u7b49\u5047\u671f\u7ed3\u675f\u56de\u5f52\u5de5\u4f5c\u5c97\u4f4d\u65f6\uff0c\u518d\u4f7f\u7528\u8be5\u547d\u4ee4\u5141\u8bb8\u7528\u6237\u767b\u5f55\u7cfb\u7edf\uff0c\u800c\u4e0d\u662f\u5c06\u5176\u5220\u9664\u3002\u8fd9\u6837\u65e2\u4fdd\u8bc1\u4e86\u8fd9\u6bb5\u65f6\u95f4\u5185\u7cfb\u7edf\u7684\u5b89\u5168\uff0c\u4e5f\u907f\u514d\u4e86\u9891\u7e41\u6dfb\u52a0\u3001\u5220\u9664\u7528\u6237\u5e26\u6765\u7684\u9ebb\u70e6\uff1a<\/p>\n 5. \u00a0userdel\u547d\u4ee4<\/strong><\/p>\n userdel\u547d\u4ee4\u7528\u4e8e\u5220\u9664\u7528\u6237\uff0c\u683c\u5f0f\u4e3a\u201cuserdel [\u9009\u9879] \u7528\u6237\u540d\u201d\u3002<\/p>\n \u5982\u679c\u6211\u4eec\u786e\u8ba4\u67d0\u4f4d\u7528\u6237\u540e\u7eed\u4e0d\u518d\u4f1a\u767b\u5f55\u5230\u7cfb\u7edf\u4e2d\uff0c\u5219\u53ef\u4ee5\u901a\u8fc7userdel\u547d\u4ee4\u5220\u9664\u8be5\u7528\u6237\u7684\u6240\u6709\u4fe1\u606f\u3002\u5728\u6267\u884c\u5220\u9664\u64cd\u4f5c\u65f6\uff0c\u8be5\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u9ed8\u8ba4\u4f1a\u4fdd\u7559\u4e0b\u6765\uff0c\u6b64\u65f6\u53ef\u4ee5\u4f7f\u7528-r\u53c2\u6570\u5c06\u5176\u5220\u9664\u3002userdel\u547d\u4ee4\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528\u5982\u88685-4\u6240\u793a\u3002<\/p>\n \u88685-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 userdel\u547d\u4ee4\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528<\/p>\n <\/p>\n \u4e0b\u9762\u4f7f\u7528userdel\u547d\u4ee4\u5c06linuxprobe\u7528\u6237\u5220\u9664\uff0c\u5176\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n \u5c3d\u7ba1\u5728Linux\u7cfb\u7edf\u4e2d\u4e00\u5207\u90fd\u662f\u6587\u4ef6\uff0c\u4f46\u662f\u6bcf\u4e2a\u6587\u4ef6\u7684\u7c7b\u578b\u4e0d\u5c3d\u76f8\u540c\uff0c\u56e0\u6b64Linux\u7cfb\u7edf\u4f7f\u7528\u4e86\u4e0d\u540c\u7684\u5b57\u7b26\u6765\u52a0\u4ee5\u533a\u5206\uff0c\u5e38\u89c1\u7684\u5b57\u7b26\u5982\u4e0b\u6240\u793a\u3002<\/p>\n \u00a0-\uff1a\u666e\u901a\u6587\u4ef6\u3002<\/p>\n d\uff1a\u76ee\u5f55\u6587\u4ef6\u3002<\/p>\n l\uff1a\u94fe\u63a5\u6587\u4ef6\u3002<\/p>\n b\uff1a\u5757\u8bbe\u5907\u6587\u4ef6\u3002<\/p>\n c\uff1a\u5b57\u7b26\u8bbe\u5907\u6587\u4ef6\u3002<\/p>\n p\uff1a\u7ba1\u9053\u6587\u4ef6\u3002<\/p><\/blockquote>\n \u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u6bcf\u4e2a\u6587\u4ef6\u90fd\u6709\u6240\u5c5e\u7684\u6240\u6709\u8005\u548c\u6240\u6709\u7ec4\uff0c\u5e76\u4e14\u89c4\u5b9a\u4e86\u6587\u4ef6\u7684\u6240\u6709\u8005\u3001\u6240\u6709\u7ec4\u4ee5\u53ca\u5176\u4ed6\u4eba\u5bf9\u6587\u4ef6\u6240\u62e5\u6709\u7684\u53ef\u8bfb\uff08r\uff09\u3001\u53ef\u5199\uff08w\uff09\u3001\u53ef\u6267\u884c\uff08x\uff09\u7b49\u6743\u9650\u3002\u5bf9\u4e8e\u4e00\u822c\u6587\u4ef6\u6765\u8bf4\uff0c\u6743\u9650\u6bd4\u8f83\u5bb9\u6613\u7406\u89e3\uff1a\u201c\u53ef\u8bfb\u201d\u8868\u793a\u80fd\u591f\u8bfb\u53d6\u6587\u4ef6\u7684\u5b9e\u9645\u5185\u5bb9\uff1b\u201c\u53ef\u5199\u201d\u8868\u793a\u80fd\u591f\u7f16\u8f91\u3001\u65b0\u589e\u3001\u4fee\u6539\u3001\u5220\u9664\u6587\u4ef6\u7684\u5b9e\u9645\u5185\u5bb9\uff1b\u201c\u53ef\u6267\u884c\u201d\u5219\u8868\u793a\u80fd\u591f\u8fd0\u884c\u4e00\u4e2a\u811a\u672c\u7a0b\u5e8f\u3002\u4f46\u662f\uff0c\u5bf9\u4e8e\u76ee\u5f55\u6587\u4ef6\u6765\u8bf4\uff0c\u7406\u89e3\u5176\u6743\u9650\u8bbe\u7f6e\u6765\u5c31\u4e0d\u90a3\u4e48\u5bb9\u6613\u4e86\u3002\u5f88\u591a\u8d44\u6df1Linux\u7528\u6237\u5176\u5b9e\u4e5f\u6ca1\u6709\u771f\u6b63\u641e\u660e\u767d\u3002<\/p>\n \u5218\u9044\u8001\u5e08\u5728\u8fd9\u91cc\u7ed9\u5927\u5bb6\u8be6\u7ec6\u8bb2\u89e3\u4e00\u4e0b\u76ee\u5f55\u6587\u4ef6\u7684\u6743\u9650\u8bbe\u7f6e\u3002\u5bf9\u76ee\u5f55\u6587\u4ef6\u6765\u8bf4\uff0c\u201c\u53ef\u8bfb\u201d\u8868\u793a\u80fd\u591f\u8bfb\u53d6\u76ee\u5f55\u5185\u7684\u6587\u4ef6\u5217\u8868\uff1b\u201c\u53ef\u5199\u201d\u8868\u793a\u80fd\u591f\u5728\u76ee\u5f55\u5185\u65b0\u589e\u3001\u5220\u9664\u3001\u91cd\u547d\u540d\u6587\u4ef6\uff1b\u800c\u201c\u53ef\u6267\u884c\u201d\u5219\u8868\u793a\u80fd\u591f\u8fdb\u5165\u8be5\u76ee\u5f55\u3002<\/p>\n \u6587\u4ef6\u7684\u8bfb\u3001\u5199\u3001\u6267\u884c\u6743\u9650\u53ef\u4ee5\u7b80\u5199\u4e3arwx\uff0c\u4ea6\u53ef\u5206\u522b\u7528\u6570\u5b574\u30012\u30011\u6765\u8868\u793a\uff0c\u6587\u4ef6\u6240\u6709\u8005\uff0c\u6240\u5c5e\u7ec4\u53ca\u5176\u4ed6\u7528\u6237\u6743\u9650\u4e4b\u95f4\u65e0\u5173\u8054\uff0c\u5982\u88685-5\u6240\u793a\u3002<\/p>\n \u88685-5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u6587\u4ef6\u6743\u9650\u7684\u5b57\u7b26\u4e0e\u6570\u5b57\u8868\u793a<\/p>\n <\/p>\n \u6587\u4ef6\u6743\u9650\u7684\u6570\u5b57\u6cd5\u8868\u793a\u57fa\u4e8e\u5b57\u7b26\u8868\u793a\uff08rwx\uff09\u7684\u6743\u9650\u8ba1\u7b97\u800c\u6765\uff0c\u5176\u76ee\u7684\u662f\u7b80\u5316\u6743\u9650\u7684\u8868\u793a\u3002\u4f8b\u5982\uff0c\u82e5\u67d0\u4e2a\u6587\u4ef6\u7684\u6743\u9650\u4e3a7<\/strong>\u5219\u4ee3\u8868\u53ef\u8bfb\u3001\u53ef\u5199\u3001\u53ef\u6267\u884c\uff084+2+1\uff09\uff1b\u82e5\u6743\u9650\u4e3a6\u5219\u4ee3\u8868\u53ef\u8bfb\u3001\u53ef\u5199\uff084+2\uff09\u3002\u6211\u4eec\u6765\u770b\u8fd9\u6837\u4e00\u4e2a\u4f8b\u5b50\u3002\u73b0\u5728\u6709\u8fd9\u6837\u4e00\u4e2a\u6587\u4ef6\uff0c\u5176\u6240\u6709\u8005\u62e5\u6709\u53ef\u8bfb\u3001\u53ef\u5199\u3001\u53ef\u6267\u884c\u7684\u6743\u9650\uff0c\u5176\u6587\u4ef6\u6240\u5c5e\u7ec4\u62e5\u6709\u53ef\u8bfb\u3001\u53ef\u5199\u7684\u6743\u9650\uff1b\u800c\u4e14\u5176\u4ed6\u4eba\u53ea\u6709\u53ef\u8bfb\u7684\u6743\u9650\u3002\u90a3\u4e48\uff0c\u8fd9\u4e2a\u6587\u4ef6\u7684\u6743\u9650\u5c31\u662frwxrw-r--\uff0c\u6570\u5b57\u6cd5\u8868\u793a\u5373\u4e3a764\u3002\u4e0d\u8fc7\u5927\u5bb6\u5343\u4e07\u522b\u518d\u5c06\u8fd9\u4e09\u4e2a\u6570\u5b57\u76f8\u52a0\uff0c\u8ba1\u7b97\u51fa7+6+4=17\u7684\u7ed3\u679c\uff0c\u8fd9\u662f\u5c0f\u5b66\u7684\u6570\u5b66\u52a0\u51cf\u6cd5\uff0c\u4e0d\u662fLinux\u7cfb\u7edf\u7684\u6743\u9650\u6570\u5b57\u8868\u793a\u6cd5\uff0c\u4e09\u8005\u4e4b\u95f4\u6ca1\u6709\u4e92\u901a\u5173\u7cfb\u3002<\/p>\n Linux\u7cfb\u7edf\u7684\u6587\u4ef6\u6743\u9650\u76f8\u5f53\u590d\u6742\uff0c\u4f46\u662f\u7528\u9014\u5f88\u5e7f\u6cdb\uff0c\u5efa\u8bae\u5927\u5bb6\u628a\u5b83\u5f7b\u5e95\u641e\u6e05\u695a\u4e4b\u540e\u518d\u5b66\u4e60\u4e0b\u4e00\u8282\u7684\u5185\u5bb9\u3002\u73b0\u5728\u6765\u7ec3\u4e60\u4e00\u4e0b\u3002\u8bf7\u5404\u4f4d\u8bfb\u8005\u5206\u522b\u8ba1\u7b97\u6570\u5b57\u8868\u793a\u6cd5764\u3001642\u3001153\u3001731\u6240\u5bf9\u5e94\u7684\u5b57\u7b26\u8868\u793a\u6cd5\uff0c\u7136\u540e\u518d\u628arwxrw-r--\u3001rw--w--wx\u3001rw-r--r--\u8f6c\u6362\u6210\u6570\u5b57\u8868\u793a\u6cd5\u3002<\/p>\n \u4e0b\u9762\u6211\u4eec\u5229\u7528\u4e0a\u6587\u8bb2\u89e3\u7684\u77e5\u8bc6\uff0c\u4e00\u8d77\u5206\u6790\u56fe5-1\u4e2d\u6240\u793a\u7684\u6587\u4ef6\u4fe1\u606f\u3002<\/p>\n <\/p>\n \u56fe5-1 \u901a\u8fc7ls\u547d\u4ee4\u67e5\u770b\u5230\u7684\u6587\u4ef6\u5c5e\u6027\u4fe1\u606f<\/p>\n \u5728\u56fe5-1\u4e2d\uff0c\u5305\u542b\u4e86\u6587\u4ef6\u7684\u7c7b\u578b\u3001\u8bbf\u95ee\u6743\u9650\u3001\u6240\u6709\u8005\uff08\u5c5e\u4e3b\uff09\u3001\u6240\u5c5e\u7ec4\uff08\u5c5e\u7ec4\uff09\u3001\u5360\u7528\u7684\u78c1\u76d8\u5927\u5c0f\u3001\u4fee\u6539\u65f6\u95f4\u548c\u6587\u4ef6\u540d\u79f0\u7b49\u4fe1\u606f\u3002\u901a\u8fc7\u5206\u6790\u53ef\u77e5\uff0c\u8be5\u6587\u4ef6\u7684\u7c7b\u578b\u4e3a\u666e\u901a\u6587\u4ef6\uff0c\u6240\u6709\u8005\u6743\u9650\u4e3a\u53ef\u8bfb\u3001\u53ef\u5199\uff08rw-\uff09\uff0c\u6240\u5c5e\u7ec4\u6743\u9650\u4e3a\u53ef\u8bfb\uff08r--\uff09\uff0c\u9664\u6b64\u4ee5\u5916\u7684\u5176\u4ed6\u4eba\u4e5f\u53ea\u6709\u53ef\u8bfb\u6743\u9650\uff08r--\uff09\uff0c\u6587\u4ef6\u7684\u78c1\u76d8\u5360\u7528\u5927\u5c0f\u662f34298\u5b57\u8282\uff0c\u6700\u8fd1\u4e00\u6b21\u7684\u4fee\u6539\u65f6\u95f4\u4e3a4\u67082\u65e5\u7684\u51cc\u666823\u5206\uff0c\u6587\u4ef6\u7684\u540d\u79f0\u4e3ainstall.log\u3002<\/p>\n \u5728\u590d\u6742\u591a\u53d8\u7684\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u5355\u7eaf\u8bbe\u7f6e\u6587\u4ef6\u7684rwx\u6743\u9650\u65e0\u6cd5\u6ee1\u8db3\u6211\u4eec\u5bf9\u5b89\u5168\u548c\u7075\u6d3b\u6027\u7684\u9700\u6c42\uff0c\u56e0\u6b64\u4fbf\u6709\u4e86SUID\u3001SGID\u4e0eSBIT\u7684\u7279\u6b8a\u6743\u9650\u4f4d\u3002\u8fd9\u662f\u4e00\u79cd\u5bf9\u6587\u4ef6\u6743\u9650\u8fdb\u884c\u8bbe\u7f6e\u7684\u7279\u6b8a\u529f\u80fd\uff0c\u53ef\u4ee5\u4e0e\u4e00\u822c\u6743\u9650\u540c\u65f6\u4f7f\u7528\uff0c\u4ee5\u5f25\u8865\u4e00\u822c\u6743\u9650\u4e0d\u80fd\u5b9e\u73b0\u7684\u529f\u80fd\u3002\u4e0b\u9762\u5177\u4f53\u89e3\u91ca\u8fd93\u4e2a\u7279\u6b8a\u6743\u9650\u4f4d\u7684\u529f\u80fd\u4ee5\u53ca\u7528\u6cd5\u3002<\/p>\n 1. \u00a0SUID<\/strong><\/p>\n SUID\u662f\u4e00\u79cd\u5bf9\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u8fdb\u884c\u8bbe\u7f6e\u7684\u7279\u6b8a\u6743\u9650\uff0c\u53ef\u4ee5\u8ba9\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u7684\u6267\u884c\u8005\u4e34\u65f6\u62e5\u6709\u5c5e\u4e3b\u7684\u6743\u9650\uff08\u4ec5\u5bf9\u62e5\u6709\u6267\u884c\u6743\u9650\u7684\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u6709\u6548\uff09\u3002\u4f8b\u5982\uff0c\u6240\u6709\u7528\u6237\u90fd\u53ef\u4ee5\u6267\u884cpasswd\u547d\u4ee4\u6765\u4fee\u6539\u81ea\u5df1\u7684\u7528\u6237\u5bc6\u7801\uff0c\u800c\u7528\u6237\u5bc6\u7801\u4fdd\u5b58\u5728\/etc\/shadow\u6587\u4ef6\u4e2d\u3002\u4ed4\u7ec6\u67e5\u770b\u8fd9\u4e2a\u6587\u4ef6\u5c31\u4f1a\u53d1\u73b0\u5b83\u7684\u9ed8\u8ba4\u6743\u9650\u662f000\uff0c\u4e5f\u5c31\u662f\u8bf4\u9664\u4e86root\u7ba1\u7406\u5458\u4ee5\u5916\uff0c\u6240\u6709\u7528\u6237\u90fd\u6ca1\u6709\u67e5\u770b\u6216\u7f16\u8f91\u8be5\u6587\u4ef6\u7684\u6743\u9650\u3002\u4f46\u662f\uff0c\u5728\u4f7f\u7528passwd\u547d\u4ee4\u65f6\u5982\u679c\u52a0\u4e0aSUID\u7279\u6b8a\u6743\u9650\u4f4d\uff0c\u5c31\u53ef\u8ba9\u666e\u901a\u7528\u6237\u4e34\u65f6\u83b7\u5f97\u7a0b\u5e8f\u6240\u6709\u8005\u7684\u8eab\u4efd\uff0c\u628a\u53d8\u66f4\u7684\u5bc6\u7801\u4fe1\u606f\u5199\u5165\u5230shadow\u6587\u4ef6\u4e2d\u3002\u8fd9\u5f88\u50cf\u6211\u4eec\u5728\u53e4\u88c5\u5267\u4e2d\u89c1\u5230\u7684\u624b\u6301\u5c1a\u65b9\u5b9d\u5251\u7684\u94a6\u5dee\u5927\u81e3\uff0c\u4ed6\u624b\u6301\u7684\u5c1a\u65b9\u5b9d\u5251\u4ee3\u8868\u7684\u662f\u7687\u4e0a\u7684\u6743\u5a01\uff0c\u56e0\u6b64\u53ef\u4ee5\u60e9\u6212\u8d2a\u5b98\uff0c\u4f46\u8fd9\u5e76\u4e0d\u610f\u5473\u7740\u4ed6\u6c38\u4e45\u6210\u4e3a\u4e86\u7687\u4e0a\u3002\u56e0\u6b64\u8fd9\u53ea\u662f\u4e00\u79cd\u6709\u6761\u4ef6\u7684\u3001\u4e34\u65f6\u7684\u7279\u6b8a\u6743\u9650\u6388\u6743\u65b9\u6cd5\u3002<\/p>\n \u67e5\u770bpasswd\u547d\u4ee4\u5c5e\u6027\u65f6\u53d1\u73b0\u6240\u6709\u8005\u7684\u6743\u9650\u7531rwx\u53d8\u6210\u4e86rws\uff0c\u5176\u4e2dx\u6539\u53d8\u6210s\u5c31\u610f\u5473\u7740\u8be5\u6587\u4ef6\u88ab\u8d4b\u4e88\u4e86SUID\u6743\u9650\u3002\u53e6\u5916\u6709\u8bfb\u8005\u4f1a\u597d\u5947\uff0c\u90a3\u4e48\u5982\u679c\u539f\u672c\u7684\u6743\u9650\u662frw-\u5462\uff1f\u5982\u679c\u539f\u5148\u6743\u9650\u4f4d\u4e0a\u6ca1\u6709x\u6267\u884c\u6743\u9650\uff0c\u90a3\u4e48\u88ab\u8d4b\u4e88\u7279\u6b8a\u6743\u9650\u540e\u5c06\u53d8\u6210\u5927\u5199\u7684S\u3002<\/p>\n 2. \u00a0SGID<\/strong><\/p>\n SGID\u4e3b\u8981\u5b9e\u73b0\u5982\u4e0b\u4e24\u79cd\u529f\u80fd\uff1a<\/p>\n \u8ba9\u6267\u884c\u8005\u4e34\u65f6\u62e5\u6709\u5c5e\u7ec4\u7684\u6743\u9650\uff08\u5bf9\u62e5\u6709\u6267\u884c\u6743\u9650\u7684\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u8fdb\u884c\u8bbe\u7f6e\uff09\uff1b<\/p>\n \u5728\u67d0\u4e2a\u76ee\u5f55\u4e2d\u521b\u5efa\u7684\u6587\u4ef6\u81ea\u52a8\u7ee7\u627f\u8be5\u76ee\u5f55\u7684\u7528\u6237\u7ec4\uff08\u53ea\u53ef\u4ee5\u5bf9\u76ee\u5f55\u8fdb\u884c\u8bbe\u7f6e\uff09\u3002<\/p><\/blockquote>\n SGID\u7684\u7b2c\u4e00\u79cd\u529f\u80fd\u662f\u53c2\u8003SUID\u800c\u8bbe\u8ba1\u7684\uff0c\u4e0d\u540c\u70b9\u5728\u4e8e\u6267\u884c\u7a0b\u5e8f\u7684\u7528\u6237\u83b7\u53d6\u7684\u4e0d\u518d\u662f\u6587\u4ef6\u6240\u6709\u8005\u7684\u4e34\u65f6\u6743\u9650\uff0c\u800c\u662f\u83b7\u53d6\u5230\u6587\u4ef6\u6240\u5c5e\u7ec4\u7684\u6743\u9650\u3002\u4e3e\u4f8b\u6765\u8bf4\uff0c\u5728\u65e9\u671f\u7684Linux\u7cfb\u7edf\u4e2d\uff0c\/dev\/kmem\u662f\u4e00\u4e2a\u5b57\u7b26\u8bbe\u5907\u6587\u4ef6\uff0c\u7528\u4e8e\u5b58\u50a8\u5185\u6838\u7a0b\u5e8f\u8981\u8bbf\u95ee\u7684\u6570\u636e\uff0c\u6743\u9650\u4e3a\uff1a<\/p>\n cr--r-----<\/strong>\u00a0\u00a0 1 root system 2,\u00a0 1 Feb 11 2017 \u00a0kmem<\/p><\/blockquote>\n \u5927\u5bb6\u770b\u51fa\u95ee\u9898\u4e86\u5417\uff1f\u9664\u4e86root\u7ba1\u7406\u5458\u6216\u5c5e\u4e8esystem\u7ec4\u6210\u5458\u5916\uff0c\u6240\u6709\u7528\u6237\u90fd\u6ca1\u6709\u8bfb\u53d6\u8be5\u6587\u4ef6\u7684\u6743\u9650\u3002\u7531\u4e8e\u5728\u5e73\u65f6\u6211\u4eec\u9700\u8981\u67e5\u770b\u7cfb\u7edf\u7684\u8fdb\u7a0b\u72b6\u6001\uff0c\u4e3a\u4e86\u80fd\u591f\u83b7\u53d6\u5230\u8fdb\u7a0b\u7684\u72b6\u6001\u4fe1\u606f\uff0c\u53ef\u5728\u7528\u4e8e\u67e5\u770b\u7cfb\u7edf\u8fdb\u7a0b\u72b6\u6001\u7684ps\u547d\u4ee4\u6587\u4ef6\u4e0a\u589e\u52a0SGID\u7279\u6b8a\u6743\u9650\u4f4d\u3002\u67e5\u770bps\u547d\u4ee4\u6587\u4ef6\u7684\u5c5e\u6027\u4fe1\u606f\uff1a<\/p>\n -r-xr-s<\/strong>r-x\u00a0\u00a0 1 bin system 59346 Feb 11\u00a02017 \u00a0ps<\/p><\/blockquote>\n \u8fd9\u6837\u4e00\u6765\uff0c\u7531\u4e8eps\u547d\u4ee4\u88ab\u589e\u52a0\u4e86SGID\u7279\u6b8a\u6743\u9650\u4f4d\uff0c\u6240\u4ee5\u5f53\u7528\u6237\u6267\u884c\u8be5\u547d\u4ee4\u65f6\uff0c\u4e5f\u5c31\u4e34\u65f6\u83b7\u53d6\u5230\u4e86system\u7528\u6237\u7ec4\u7684\u6743\u9650\uff0c\u4ece\u800c\u53ef\u4ee5\u987a\u5229\u5730\u8bfb\u53d6\u8bbe\u5907\u6587\u4ef6\u4e86\u3002<\/p>\n \u524d\u6587\u63d0\u5230\uff0c\u6bcf\u4e2a\u6587\u4ef6\u90fd\u6709\u5176\u5f52\u5c5e\u7684\u6240\u6709\u8005\u548c\u6240\u5c5e\u7ec4\uff0c\u5f53\u521b\u5efa\u6216\u4f20\u9001\u4e00\u4e2a\u6587\u4ef6\u540e\uff0c\u8fd9\u4e2a\u6587\u4ef6\u5c31\u4f1a\u81ea\u52a8\u5f52\u5c5e\u4e8e\u6267\u884c\u8fd9\u4e2a\u64cd\u4f5c\u7684\u7528\u6237\uff08\u5373\u8be5\u7528\u6237\u662f\u6587\u4ef6\u7684\u6240\u6709\u8005\uff09\u3002\u5982\u679c\u73b0\u5728\u9700\u8981\u5728\u4e00\u4e2a\u90e8\u95e8\u5185\u8bbe\u7f6e\u5171\u4eab\u76ee\u5f55\uff0c\u8ba9\u90e8\u95e8\u5185\u7684\u6240\u6709\u4eba\u5458\u90fd\u80fd\u591f\u8bfb\u53d6\u76ee\u5f55\u4e2d\u7684\u5185\u5bb9\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u521b\u5efa\u90e8\u95e8\u5171\u4eab\u76ee\u5f55\u540e\uff0c\u5728\u8be5\u76ee\u5f55\u4e0a\u8bbe\u7f6eSGID\u7279\u6b8a\u6743\u9650\u4f4d\u3002\u8fd9\u6837\uff0c\u90e8\u95e8\u5185\u7684\u4efb\u4f55\u4eba\u5458\u5728\u91cc\u9762\u521b\u5efa\u7684\u4efb\u4f55\u6587\u4ef6\u90fd\u4f1a\u5f52\u5c5e\u4e8e\u8be5\u76ee\u5f55\u7684\u6240\u5c5e\u7ec4\uff0c\u800c\u4e0d\u518d\u662f\u81ea\u5df1\u7684\u57fa\u672c\u7528\u6237\u7ec4\u3002\u6b64\u65f6\uff0c\u6211\u4eec\u7528\u5230\u7684\u5c31\u662fSGID\u7684\u7b2c\u4e8c\u4e2a\u529f\u80fd\uff0c\u5373\u5728\u67d0\u4e2a\u76ee\u5f55\u4e2d\u521b\u5efa\u7684\u6587\u4ef6\u81ea\u52a8\u7ee7\u627f\u8be5\u76ee\u5f55\u7684\u7528\u6237\u7ec4\uff08\u53ea\u53ef\u4ee5\u5bf9\u76ee\u5f55\u8fdb\u884c\u8bbe\u7f6e\uff09\u3002<\/p>\n \u5728\u4f7f\u7528\u4e0a\u8ff0\u547d\u4ee4\u8bbe\u7f6e\u597d\u76ee\u5f55\u7684777\u6743\u9650\uff08\u786e\u4fdd\u666e\u901a\u7528\u6237\u53ef\u4ee5\u5411\u5176\u4e2d\u5199\u5165\u6587\u4ef6\uff09\uff0c\u5e76\u4e3a\u8be5\u76ee\u5f55\u8bbe\u7f6e\u4e86SGID\u7279\u6b8a\u6743\u9650\u4f4d\u540e\uff0c\u5c31\u53ef\u4ee5\u5207\u6362\u81f3\u4e00\u4e2a\u666e\u901a\u7528\u6237\uff0c\u7136\u540e\u5c1d\u8bd5\u5728\u8be5\u76ee\u5f55\u4e2d\u521b\u5efa\u6587\u4ef6\uff0c\u5e76\u67e5\u770b\u65b0\u521b\u5efa\u7684\u6587\u4ef6\u662f\u5426\u4f1a\u7ee7\u627f\u65b0\u521b\u5efa\u7684\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u7684\u6240\u5c5e\u7ec4\u540d\u79f0\uff1a<\/p>\n \u9664\u4e86\u4e0a\u9762\u63d0\u5230\u7684SGID\u7684\u8fd9\u4e24\u4e2a\u529f\u80fd\uff0c\u6211\u4eec\u518d\u4ecb\u7ecd\u4e24\u4e2a\u4e0e\u672c\u5c0f\u8282\u5185\u5bb9\u76f8\u5173\u7684\u547d\u4ee4\uff1achmod\u548cchown\u3002<\/p>\n chmod\u547d\u4ee4\u662f\u4e00\u4e2a\u975e\u5e38\u5b9e\u7528\u7684\u547d\u4ee4\uff0c\u80fd\u591f\u7528\u6765\u8bbe\u7f6e\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u6743\u9650\uff0c\u683c\u5f0f\u4e3a\u201cchmod [\u53c2\u6570] \u6743\u9650 \u6587\u4ef6\u6216\u76ee\u5f55\u540d\u79f0\u201d\u3002\u5982\u679c\u8981\u628a\u4e00\u4e2a\u6587\u4ef6\u7684\u6743\u9650\u8bbe\u7f6e\u6210\u5176\u6240\u6709\u8005\u53ef\u8bfb\u53ef\u5199\u53ef\u6267\u884c\u3001\u6240\u5c5e\u7ec4\u53ef\u8bfb\u53ef\u5199\u3001\u5176\u4ed6\u4eba\u6ca1\u6709\u4efb\u4f55\u6743\u9650\uff0c\u5219\u76f8\u5e94\u7684\u5b57\u7b26\u6cd5\u8868\u793a\u4e3arwxrw----\uff0c\u5176\u5bf9\u5e94\u7684\u6570\u5b57\u6cd5\u8868\u793a\u4e3a760\u3002\u901a\u8fc7\u524d\u9762\u7684\u57fa\u7840\u5b66\u4e60\u548c\u5f53\u524d\u7684\u7ec3\u4e60\u5b9e\u8df5\uff0c\u73b0\u5728\u5927\u5bb6\u53ef\u4ee5\u611f\u53d7\u5230\u4f7f\u7528\u6570\u5b57\u6cd5\u6765\u8bbe\u7f6e\u6587\u4ef6\u6743\u9650\u7684\u4fbf\u6377\u6027\u4e86\u5427\u3002<\/p>\n \u9664\u4e86\u8bbe\u7f6e\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u6743\u9650\u5916\uff0c\u8fd8\u53ef\u4ee5\u8bbe\u7f6e\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u6240\u6709\u8005\u548c\u6240\u5c5e\u7ec4\uff0c\u8fd9\u91cc\u4f7f\u7528\u7684\u547d\u4ee4\u4e3achown\uff0c\u5176\u683c\u5f0f\u4e3a\u201cchown [\u53c2\u6570] \u6240\u6709\u8005:\u6240\u5c5e\u7ec4 \u6587\u4ef6\u6216\u76ee\u5f55\u540d\u79f0\u201d\u3002<\/p>\n chmod\u548cchown\u547d\u4ee4\u662f\u7528\u4e8e\u4fee\u6539\u6587\u4ef6\u5c5e\u6027\u548c\u6743\u9650\u7684\u6700\u5e38\u7528\u547d\u4ee4\uff0c\u5b83\u4eec\u8fd8\u6709\u4e00\u4e2a\u7279\u522b\u7684\u5171\u6027\uff0c\u5c31\u662f\u9488\u5bf9\u76ee\u5f55\u8fdb\u884c\u64cd\u4f5c\u65f6\u9700\u8981\u52a0\u4e0a\u5927\u5199\u53c2\u6570-R\u6765\u8868\u793a\u9012\u5f52\u64cd\u4f5c\uff0c\u5373\u5bf9\u76ee\u5f55\u5185\u6240\u6709\u7684\u6587\u4ef6\u8fdb\u884c\u6574\u4f53\u64cd\u4f5c\u3002<\/p>\n 3. \u00a0SBIT<\/strong><\/p>\n \u73b0\u5728\uff0c\u5927\u5b66\u91cc\u7684\u5f88\u591a\u8001\u5e08\u90fd\u8981\u6c42\u5b66\u751f\u5c06\u4f5c\u4e1a\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u7684\u7279\u5b9a\u5171\u4eab\u76ee\u5f55\u4e2d\uff0c\u4f46\u603b\u662f\u6709\u51e0\u4e2a\u201c\u7834\u574f\u5206\u5b50\u201d\u559c\u6b22\u5220\u9664\u5176\u4ed6\u540c\u5b66\u7684\u4f5c\u4e1a\uff0c\u8fd9\u65f6\u5c31\u8981\u8bbe\u7f6eSBIT\uff08Sticky Bit\uff09\u7279\u6b8a\u6743\u9650\u4f4d\u4e86\uff08\u4e5f\u53ef\u4ee5\u79f0\u4e4b\u4e3a\u7279\u6b8a\u6743\u9650\u4f4d\u4e4b\u7c98\u6ede\u4f4d\uff09\u3002SBIT\u7279\u6b8a\u6743\u9650\u4f4d\u53ef\u786e\u4fdd\u7528\u6237\u53ea\u80fd\u5220\u9664\u81ea\u5df1\u7684\u6587\u4ef6\uff0c\u800c\u4e0d\u80fd\u5220\u9664\u5176\u4ed6\u7528\u6237\u7684\u6587\u4ef6\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5f53\u5bf9\u67d0\u4e2a\u76ee\u5f55\u8bbe\u7f6e\u4e86SBIT\u7c98\u6ede\u4f4d\u6743\u9650\u540e\uff0c\u90a3\u4e48\u8be5\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u5c31\u53ea\u80fd\u88ab\u5176\u6240\u6709\u8005\u6267\u884c\u5220\u9664\u64cd\u4f5c\u4e86\u3002<\/p>\n \u6700\u521d\u4e0d\u77e5\u9053\u662f\u54ea\u4f4d\u975e\u8d44\u6df1\u6280\u672f\u4eba\u5458\u5c06Sticky Bit\u76f4\u8bd1\u6210\u4e86\u201c\u7c98\u6ede\u4f4d\u201d\uff0c\u5218\u9044\u8001\u5e08\u5efa\u8bae\u5c06\u5176\u79f0\u4e3a\u201c\u4fdd\u62a4\u4f4d\u201d\uff0c\u8fd9\u65e2\u597d\u8bb0\uff0c\u53c8\u80fd\u7acb\u523b\u8ba9\u4eba\u4e86\u89e3\u5b83\u7684\u4f5c\u7528\u3002RHEL 7\u7cfb\u7edf\u4e2d\u7684\/tmp\u4f5c\u4e3a\u4e00\u4e2a\u5171\u4eab\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u9ed8\u8ba4\u5df2\u7ecf\u8bbe\u7f6e\u4e86SBIT\u7279\u6b8a\u6743\u9650\u4f4d\uff0c\u56e0\u6b64\u9664\u975e\u662f\u8be5\u76ee\u5f55\u7684\u6240\u6709\u8005\uff0c\u5426\u5219\u65e0\u6cd5\u5220\u9664\u8fd9\u91cc\u9762\u7684\u6587\u4ef6\u3002<\/p>\n \u4e0e\u524d\u9762\u6240\u8bb2\u7684SUID\u548cSGID\u6743\u9650\u663e\u793a\u65b9\u6cd5\u4e0d\u540c\uff0c\u5f53\u76ee\u5f55\u88ab\u8bbe\u7f6eSBIT\u7279\u6b8a\u6743\u9650\u4f4d\u540e\uff0c\u6587\u4ef6\u7684\u5176\u4ed6\u4eba\u6743\u9650\u90e8\u5206\u7684x\u6267\u884c\u6743\u9650\u5c31\u4f1a\u88ab\u66ff\u6362\u6210t\u6216\u8005T\uff0c\u539f\u672c\u6709x\u6267\u884c\u6743\u9650\u5219\u4f1a\u5199\u6210t\uff0c\u539f\u672c\u6ca1\u6709x\u6267\u884c\u6743\u9650\u5219\u4f1a\u88ab\u5199\u6210T\u3002<\/p>\n \u5176\u5b9e\uff0c\u6587\u4ef6\u80fd\u5426\u88ab\u5220\u9664\u5e76\u4e0d\u53d6\u51b3\u4e8e\u81ea\u8eab\u7684\u6743\u9650\uff0c\u800c\u662f\u770b\u5176\u6240\u5728\u76ee\u5f55\u662f\u5426\u6709\u5199\u5165\u6743\u9650\uff08\u5176\u539f\u7406\u4f1a\u5728\u4e0b\u4e2a\u7ae0\u8282\u8bb2\u5230\uff09\u3002\u4e3a\u4e86\u907f\u514d\u73b0\u5728\u5f88\u591a\u8bfb\u8005\u4e0d\u653e\u5fc3\uff0c\u6240\u4ee5\u4e0a\u9762\u7684\u547d\u4ee4\u8fd8\u662f\u8d4b\u4e88\u4e86\u8fd9\u4e2atest\u6587\u4ef6\u6700\u5927\u7684777\u6743\u9650\uff08rwxrwxrwx\uff09\u3002\u6211\u4eec\u5207\u6362\u5230\u53e6\u5916\u4e00\u4e2a\u666e\u901a\u7528\u6237\uff0c\u7136\u540e\u5c1d\u8bd5\u5220\u9664\u8fd9\u4e2a\u5176\u4ed6\u4eba\u521b\u5efa\u7684\u6587\u4ef6\u5c31\u4f1a\u53d1\u73b0\uff0c\u5373\u4fbf\u8bfb\u3001\u5199\u3001\u6267\u884c\u6743\u9650\u5168\u5f00\uff0c\u4f46\u662f\u7531\u4e8eSBIT\u7279\u6b8a\u6743\u9650\u4f4d\u7684\u7f18\u6545\uff0c\u4f9d\u7136\u65e0\u6cd5\u5220\u9664\u8be5\u6587\u4ef6\uff1a<\/p>\n \u5f53\u7136\uff0c\u8981\u662f\u4e5f\u60f3\u5bf9\u5176\u4ed6\u76ee\u5f55\u6765\u8bbe\u7f6eSBIT\u7279\u6b8a\u6743\u9650\u4f4d\uff0c\u7528chmod\u547d\u4ee4\u5c31\u53ef\u4ee5\u4e86\u3002\u5bf9\u5e94\u7684\u53c2\u6570o+t\u4ee3\u8868\u8bbe\u7f6eSBIT\u7c98\u6ede\u4f4d\u6743\u9650\uff1a<\/p>\n Linux\u7cfb\u7edf\u4e2d\u7684\u6587\u4ef6\u9664\u4e86\u5177\u5907\u4e00\u822c\u6743\u9650\u548c\u7279\u6b8a\u6743\u9650\u4e4b\u5916\uff0c\u8fd8\u6709\u4e00\u79cd\u9690\u85cf\u6743\u9650\uff0c\u5373\u88ab\u9690\u85cf\u8d77\u6765\u7684\u6743\u9650\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e0d\u80fd\u76f4\u63a5\u88ab\u7528\u6237\u53d1\u89c9\u3002\u6709\u7528\u6237\u66fe\u7ecf\u5728\u751f\u4ea7\u73af\u5883\u548cRHCE<\/a>\u8003\u8bd5\u9898\u76ee\u4e2d\u78b0\u5230\u8fc7\u660e\u660e\u6743\u9650\u5145\u8db3\u4f46\u5374\u65e0\u6cd5\u5220\u9664\u67d0\u4e2a\u6587\u4ef6\u7684\u60c5\u51b5\uff0c\u6216\u8005\u4ec5\u80fd\u5728\u65e5\u5fd7\u6587\u4ef6\u4e2d\u8ffd\u52a0\u5185\u5bb9\u800c\u4e0d\u80fd\u4fee\u6539\u6216\u5220\u9664\u5185\u5bb9\uff0c\u8fd9\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u963b\u6b62\u4e86\u9ed1\u5ba2\u7be1\u6539\u7cfb\u7edf\u65e5\u5fd7\u7684\u56fe\u8c0b\uff0c\u56e0\u6b64\u8fd9\u79cd\u201c\u5947\u602a\u201d\u7684\u6587\u4ef6\u4e5f\u4fdd\u969c\u4e86Linux\u7cfb\u7edf\u7684\u5b89\u5168\u6027\u3002<\/p>\n 1. \u00a0chattr\u547d\u4ee4<\/strong><\/p>\n chattr\u547d\u4ee4\u7528\u4e8e\u8bbe\u7f6e\u6587\u4ef6\u7684\u9690\u85cf\u6743\u9650\uff0c\u683c\u5f0f\u4e3a\u201cchattr [\u53c2\u6570] \u6587\u4ef6\u201d\u3002\u5982\u679c\u60f3\u8981\u628a\u67d0\u4e2a\u9690\u85cf\u529f\u80fd\u6dfb\u52a0\u5230\u6587\u4ef6\u4e0a\uff0c\u5219\u9700\u8981\u5728\u547d\u4ee4\u540e\u9762\u8ffd\u52a0\u201c+\u53c2\u6570\u201d\uff0c\u5982\u679c\u60f3\u8981\u628a\u67d0\u4e2a\u9690\u85cf\u529f\u80fd\u79fb\u51fa\u6587\u4ef6\uff0c\u5219\u9700\u8981\u8ffd\u52a0\u201c-\u53c2\u6570\u201d\u3002chattr\u547d\u4ee4\u4e2d\u53ef\u4f9b\u9009\u62e9\u7684\u9690\u85cf\u6743\u9650\u53c2\u6570\u975e\u5e38\u4e30\u5bcc\uff0c\u5177\u4f53\u5982\u88685-6\u6240\u793a\u3002<\/p>\n \u88685-6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 chattr\u547d\u4ee4\u4e2d\u7528\u4e8e\u9690\u85cf\u6743\u9650\u7684\u53c2\u6570\u53ca\u5176\u4f5c\u7528<\/p>\n <\/p>\n \u4e3a\u4e86\u8ba9\u8bfb\u8005\u80fd\u591f\u66f4\u597d\u5730\u89c1\u8bc6\u9690\u85cf\u6743\u9650\u7684\u6548\u679c\uff0c\u6211\u4eec\u5148\u6765\u521b\u5efa\u4e00\u4e2a\u666e\u901a\u6587\u4ef6\uff0c\u7136\u540e\u7acb\u5373\u5c1d\u8bd5\u5220\u9664\uff08\u8fd9\u4e2a\u64cd\u4f5c\u80af\u5b9a\u4f1a\u6210\u529f\uff09\uff1a<\/p>\n \u5b9e\u8df5\u662f\u68c0\u9a8c\u771f\u7406\u7684\u552f\u4e00\u6807\u51c6\u3002\u5982\u679c\u60a8\u6ca1\u6709\u4eb2\u773c\u89c1\u8bc1\u8fc7\u9690\u85cf\u6743\u9650\u5f3a\u5927\u529f\u80fd\u7684\u7f8e\u5999\uff0c\u5c31\u4e00\u5b9a\u4e0d\u4f1a\u76f8\u4fe1\u539f\u6765Linux\u7cfb\u7edf\u4f1a\u5982\u6b64\u5b89\u5168\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u518d\u6b21\u65b0\u5efa\u4e00\u4e2a\u666e\u901a\u6587\u4ef6\uff0c\u5e76\u4e3a\u5176\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u5220\u9664\u4e0e\u8986\u76d6\uff08+a\u53c2\u6570\uff09\u6743\u9650\uff0c\u7136\u540e\u518d\u5c1d\u8bd5\u5c06\u8fd9\u4e2a\u6587\u4ef6\u5220\u9664\uff1a<\/p>\n \u53ef\u89c1\uff0c\u4e0a\u8ff0\u64cd\u4f5c\u5931\u8d25\u4e86\u3002<\/p>\n 2. \u00a0lsattr\u547d\u4ee4<\/strong><\/p>\n lsattr\u547d\u4ee4\u7528\u4e8e\u663e\u793a\u6587\u4ef6\u7684\u9690\u85cf\u6743\u9650\uff0c\u683c\u5f0f\u4e3a\u201clsattr [\u53c2\u6570] \u6587\u4ef6\u201d\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u6587\u4ef6\u7684\u9690\u85cf\u6743\u9650\u5fc5\u987b\u4f7f\u7528lsattr\u547d\u4ee4\u6765\u67e5\u770b\uff0c\u5e73\u65f6\u4f7f\u7528\u7684ls\u4e4b\u7c7b\u7684\u547d\u4ee4\u5219\u770b\u4e0d\u51fa\u7aef\u502a\uff1a<\/p>\n \u4e00\u65e6\u4f7f\u7528lsattr\u547d\u4ee4\u540e\uff0c\u6587\u4ef6\u4e0a\u88ab\u8d4b\u4e88\u7684\u9690\u85cf\u6743\u9650\u9a6c\u4e0a\u5c31\u4f1a\u539f\u5f62\u6bd5\u9732\u3002\u6b64\u65f6\u53ef\u4ee5\u6309\u7167\u663e\u793a\u7684\u9690\u85cf\u6743\u9650\u7684\u7c7b\u578b\uff08\u5b57\u6bcd\uff09\uff0c\u4f7f\u7528chattr\u547d\u4ee4\u5c06\u5176\u53bb\u6389\uff1a<\/p>\n \u51fa\u73b0\u95ee\u9898?\u5927\u80c6\u63d0\u95ee!<\/strong><\/span><\/p>\n \u56e0\u8bfb\u8005\u4eec\u786c\u4ef6\u4e0d\u540c\u6216\u64cd\u4f5c\u9519\u8bef\u90fd\u53ef\u80fd\u5bfc\u81f4\u5b9e\u9a8c\u914d\u7f6e\u51fa\u9519\uff0c\u8bf7\u8010\u5fc3\u518d\u4ed4\u7ec6\u770b\u770b\u64cd\u4f5c\u6b65\u9aa4\u5427\uff0c\u4e0d\u8981\u6c14\u9981~<\/p>\n5.1 \u7528\u6237\u8eab\u4efd\u4e0e\u80fd\u529b<\/strong><\/span><\/h5>\n
\n\n
\n \u53c2\u6570<\/td>\n \u4f5c\u7528<\/td>\n<\/tr>\n \n -d<\/td>\n \u6307\u5b9a\u7528\u6237\u7684\u5bb6\u76ee\u5f55\uff08\u9ed8\u8ba4\u4e3a\/home\/username\uff09<\/td>\n<\/tr>\n \n -e<\/td>\n \u8d26\u6237\u7684\u5230\u671f\u65f6\u95f4\uff0c\u683c\u5f0f\u4e3aYYYY-MM-DD.<\/td>\n<\/tr>\n \n -u<\/td>\n \u6307\u5b9a\u8be5\u7528\u6237\u7684\u9ed8\u8ba4UID<\/td>\n<\/tr>\n \n -g<\/td>\n \u6307\u5b9a\u4e00\u4e2a\u521d\u59cb\u7684\u7528\u6237\u57fa\u672c\u7ec4\uff08\u5fc5\u987b\u5df2\u5b58\u5728\uff09<\/td>\n<\/tr>\n \n -G<\/td>\n \u6307\u5b9a\u4e00\u4e2a\u6216\u591a\u4e2a\u6269\u5c55\u7528\u6237\u7ec4<\/td>\n<\/tr>\n \n -N<\/td>\n \u4e0d\u521b\u5efa\u4e0e\u7528\u6237\u540c\u540d\u7684\u57fa\u672c\u7528\u6237\u7ec4<\/td>\n<\/tr>\n \n -s<\/td>\n \u6307\u5b9a\u8be5\u7528\u6237\u7684\u9ed8\u8ba4Shell\u89e3\u91ca\u5668<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n [root@linuxprobe ~]# useradd -d \/home\/linux -u 8888 -s \/sbin\/nologin linuxprobe\r\n[root@linuxprobe ~]# id linuxprobe\r\nuid=8888(linuxprobe) gid=8888(linuxprobe) groups=8888(linuxprobe)\r\n<\/pre>\n
[root@linuxprobe ~]# groupadd ronny<\/pre>\n<\/div>\n
\n\n
\n \u53c2\u6570<\/td>\n \u4f5c\u7528<\/td>\n<\/tr>\n \n -c<\/td>\n \u586b\u5199\u7528\u6237\u8d26\u6237\u7684\u5907\u6ce8\u4fe1\u606f<\/td>\n<\/tr>\n \n -d -m<\/td>\n \u53c2\u6570-m\u4e0e\u53c2\u6570-d\u8fde\u7528\uff0c\u53ef\u91cd\u65b0\u6307\u5b9a\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u5e76\u81ea\u52a8\u628a\u65e7\u7684\u6570\u636e\u8f6c\u79fb\u8fc7\u53bb<\/td>\n<\/tr>\n \n -e<\/td>\n \u8d26\u6237\u7684\u5230\u671f\u65f6\u95f4\uff0c\u683c\u5f0f\u4e3aYYYY-MM-DD<\/td>\n<\/tr>\n \n -g<\/td>\n \u53d8\u66f4\u6240\u5c5e\u7528\u6237\u7ec4<\/td>\n<\/tr>\n \n -G<\/td>\n \u53d8\u66f4\u6269\u5c55\u7528\u6237\u7ec4<\/td>\n<\/tr>\n \n -L<\/td>\n \u9501\u5b9a\u7528\u6237\u7981\u6b62\u5176\u767b\u5f55\u7cfb\u7edf<\/td>\n<\/tr>\n \n -U<\/td>\n \u89e3\u9501\u7528\u6237\uff0c\u5141\u8bb8\u5176\u767b\u5f55\u7cfb\u7edf<\/td>\n<\/tr>\n \n -s<\/td>\n \u53d8\u66f4\u9ed8\u8ba4\u7ec8\u7aef<\/td>\n<\/tr>\n \n -u<\/td>\n \u4fee\u6539\u7528\u6237\u7684UID<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n [root@linuxprobe ~]# id linuxprobe\r\nuid=1000(linuxprobe) gid=1000(linuxprobe) groups=1000(linuxprobe)<\/pre>\n
[root@linuxprobe\u00a0~]# usermod -G root linuxprobe\r\n[root@linuxprobe\u00a0~]# id linuxprobe\r\nuid=1000(linuxprobe) gid=1000(linuxprobe) groups=1000(linuxprobe),0(root)<\/strong><\/pre>\n
[root@linuxprobe\u00a0~]# usermod -u 8888 linuxprobe\r\n[root@linuxprobe\u00a0~]# id linuxprobe\r\nuid=8888<\/strong>(linuxprobe) gid=1000(linuxprobe) groups=1000(linuxprobe),0(root)<\/pre>\n
\n\n
\n \u53c2\u6570<\/td>\n \u4f5c\u7528<\/td>\n<\/tr>\n \n -l<\/td>\n \u9501\u5b9a\u7528\u6237\uff0c\u7981\u6b62\u5176\u767b\u5f55<\/td>\n<\/tr>\n \n -u<\/td>\n \u89e3\u9664\u9501\u5b9a\uff0c\u5141\u8bb8\u7528\u6237\u767b\u5f55<\/td>\n<\/tr>\n \n --stdin<\/td>\n \u5141\u8bb8\u901a\u8fc7\u6807\u51c6\u8f93\u5165\u4fee\u6539\u7528\u6237\u5bc6\u7801<\/td>\n<\/tr>\n \n -d<\/td>\n \u4f7f\u8be5\u7528\u6237\u53ef\u7528\u7a7a\u5bc6\u7801\u767b\u5f55\u7cfb\u7edf<\/td>\n<\/tr>\n \n -e<\/td>\n \u5f3a\u5236\u7528\u6237\u5728\u4e0b\u6b21\u767b\u5f55\u65f6\u4fee\u6539\u5bc6\u7801<\/td>\n<\/tr>\n \n -S<\/td>\n \u663e\u793a\u7528\u6237\u7684\u5bc6\u7801\u662f\u5426\u88ab\u9501\u5b9a\uff0c\u4ee5\u53ca\u5bc6\u7801\u6240\u91c7\u7528\u7684\u52a0\u5bc6\u7b97\u6cd5\u540d\u79f0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n [root@linuxprobe ~]# passwd\r\nChanging password for user root.\r\nNew password:\u6b64\u5904\u8f93\u5165\u5bc6\u7801\u503c\r\n<\/strong>Retype new password: \u518d\u6b21\u8f93\u5165\u8fdb\u884c\u786e\u8ba4<\/strong>\r\npasswd: all authentication tokens updated successfully.\r\n[root@linuxprobe ~]# passwd linuxprobe\r\nChanging password for user linuxprobe.\r\nNew password:\u6b64\u5904\u8f93\u5165\u5bc6\u7801\u503c\r\n<\/strong>Retype new password: \u518d\u6b21\u8f93\u5165\u8fdb\u884c\u786e\u8ba4<\/strong>\r\npasswd: all authentication tokens updated successfully.<\/pre>\n
[root@linuxprobe ~]# passwd -l linuxprobe\r\nLocking password for user linuxprobe.\r\npasswd: Success\r\n[root@linuxprobe ~]# passwd -S linuxprobe\r\nlinuxprobe LK 2017-12-26 0 99999 7 -1 (Password locked.<\/strong>)\r\n[root@linuxprobe ~]# passwd -u linuxprobe\r\nUnlocking password for user linuxprobe.\r\npasswd: Success\r\n[root@linuxprobe ~]# passwd -S linuxprobe\r\nlinuxprobe PS 2017-12-26 0 99999 7 -1 (Password set, SHA512 crypt.<\/strong>)<\/pre>\n
\n\n
\n \u53c2\u6570<\/td>\n \u4f5c\u7528<\/td>\n<\/tr>\n \n -f<\/td>\n \u5f3a\u5236\u5220\u9664\u7528\u6237<\/td>\n<\/tr>\n \n -r<\/td>\n \u540c\u65f6\u5220\u9664\u7528\u6237\u53ca\u7528\u6237\u5bb6\u76ee\u5f55<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n [root@linuxprobe\u00a0~]# id linuxprobe\r\nuid=8888(linuxprobe) gid=1000(linuxprobe) groups=1000(linuxprobe),0(root)\r\n[root@linuxprobe\u00a0~]# userdel -r linuxprobe\r\n[root@linuxprobe\u00a0~]# id linuxprobe\r\nid: linuxprobe: no such user<\/pre>\n
5.2\u00a0\u6587\u4ef6\u6743\u9650\u4e0e\u5f52\u5c5e<\/strong><\/span><\/h5>\n
5.3 \u6587\u4ef6\u7684\u7279\u6b8a\u6743\u9650<\/span><\/strong><\/h5>\n
[root@linuxprobe ~]# ls -l \/etc\/shadow\r\n----------.<\/strong> 1 root root 1004 Jan 3 06:23 \/etc\/shadow\r\n[root@linuxprobe ~]# ls -l \/bin\/passwd\r\n-rws<\/strong>r-xr-x. 1 root root 27832 Jan 29 2017 \/bin\/passwd<\/pre>\n
[root@linuxprobe ~]# cd \/tmp\r\n[root@linuxprobe tmp]# mkdir testdir\r\n[root@linuxprobe tmp]# ls -ald testdir\/\r\ndrwxr-xr-x. 2 root root 6 Feb 11 11:50 testdir\/\r\n[root@linuxprobe tmp]# chmod -Rf 777 testdir\/\r\n[root@linuxprobe tmp]# chmod -Rf g+s testdir\/\r\n[root@linuxprobe tmp]# ls -ald testdir\/\r\ndrwxrwsrwx<\/strong>. 2 root root 6 Feb 11 11:50 testdir\/\r\n<\/pre>\n
[root@linuxprobe tmp]# su - linuxprobe\r\nLast login: Wed Feb 11 11:49:16 CST 2017 on pts\/0\r\n[linuxprobe@linuxprobe ~]$ cd \/tmp\/testdir\/\r\n[linuxprobe@linuxprobe testdir]$ echo \"lrxjmw.cn\" > test\r\n[linuxprobe@linuxprobe testdir]$ ls -al test\r\n-rw-rw-r--. 1 linuxprobe root<\/strong> 15 Feb 11 11:50 test<\/pre>\n
[root@linuxprobe ~]# ls -al test\r\n-rw-rw-r--. 1 linuxprobe root 15 Feb 11 11:50 test\r\n[root@linuxprobe ~]# chmod 760\u00a0test\r\n[root@linuxprobe ~]# ls -l test\r\n-rwxrw----. 1 linuxprobe root 15 Feb 11 11:50 test<\/pre>\n
[root@linuxprobe ~]# ls -l test\r\n-rwxrw----. 1 linuxprobe root 15 Feb 11 11:50 test\r\n[root@linuxprobe ~]# chown root:bin test\r\n[root@linuxprobe ~]# ls -l test\r\n-rwxrw----. 1 root bin 15 Feb 11 11:50 test<\/pre>\n
[root@linuxprobe tmp]# su - linuxprobe\r\nLast login: Wed Feb 11 12:41:20 CST 2017 on pts\/0\r\n[linuxprobe@linuxprobe tmp]$ ls -ald \/tmp\r\ndrwxrwxrwt<\/strong>. 17 root root 4096 Feb 11 13:03 \/tmp\r\n[linuxprobe@linuxprobe ~]$ cd \/tmp\r\n[linuxprobe@linuxprobe tmp]$ ls -ald\r\ndrwxrwxrwt. 17 root root 4096 Feb 11 13:03 .\r\n[linuxprobe@linuxprobe tmp]$ echo \"Welcome to lrxjmw.cn\" > test\r\n[linuxprobe@linuxprobe tmp]$ chmod 777 test\r\n[linuxprobe@linuxprobe tmp]$ ls -al test \r\n-rwxrwxrwx. 1 linuxprobe linuxprobe 10 Feb 11 12:59 test\r\n<\/pre>\n
[root@linuxprobe tmp]# su - blackshield\r\nLast login: Wed Feb 11 12:41:29 CST 2017 on pts\/1\r\n[blackshield@linuxprobe ~]$ cd \/tmp\r\n[blackshield@linuxprobe tmp]$ rm -f test\r\nrm: cannot remove \u2018test\u2019: Operation not permitted<\/pre>\n
[blackshield@linuxprobe\u00a0tmp]$\u00a0exit\r\nLogout\r\n[root@linuxprobe\u00a0tmp]#\u00a0cd\u00a0~\r\n[root@linuxprobe\u00a0~]#\u00a0mkdir\u00a0linux\r\n[root@linuxprobe\u00a0~]#\u00a0chmod\u00a0-R\u00a0o+t\u00a0linux\/\r\n[root@linuxprobe\u00a0~]#\u00a0ls\u00a0-ld\u00a0linux\/\r\ndrwxr-xr-t.\u00a02\u00a0root\u00a0root\u00a06\u00a0Feb\u00a011\u00a019:34\u00a0linux\/<\/pre>\n
5.4 \u6587\u4ef6\u7684\u9690\u85cf\u5c5e\u6027<\/strong><\/span><\/h5>\n
\n\n
\n \u53c2\u6570<\/td>\n \u4f5c\u7528<\/td>\n<\/tr>\n \n i<\/td>\n \u65e0\u6cd5\u5bf9\u6587\u4ef6\u8fdb\u884c\u4fee\u6539\uff1b\u82e5\u5bf9\u76ee\u5f55\u8bbe\u7f6e\u4e86\u8be5\u53c2\u6570\uff0c\u5219\u4ec5\u80fd\u4fee\u6539\u5176\u4e2d\u7684\u5b50\u6587\u4ef6\u5185\u5bb9\u800c\u4e0d\u80fd\u65b0\u5efa\u6216\u5220\u9664\u6587\u4ef6<\/td>\n<\/tr>\n \n a<\/td>\n \u4ec5\u5141\u8bb8\u8865\u5145\uff08\u8ffd\u52a0\uff09\u5185\u5bb9\uff0c\u65e0\u6cd5\u8986\u76d6\/\u5220\u9664\u5185\u5bb9\uff08Append Only\uff09<\/td>\n<\/tr>\n \n S<\/td>\n \u6587\u4ef6\u5185\u5bb9\u5728\u53d8\u66f4\u540e\u7acb\u5373\u540c\u6b65\u5230\u786c\u76d8\uff08sync\uff09<\/td>\n<\/tr>\n \n s<\/td>\n \u5f7b\u5e95\u4ece\u786c\u76d8\u4e2d\u5220\u9664\uff0c\u4e0d\u53ef\u6062\u590d\uff08\u75280\u586b\u5145\u539f\u6587\u4ef6\u6240\u5728\u786c\u76d8\u533a\u57df\uff09<\/td>\n<\/tr>\n \n A<\/td>\n \u4e0d\u518d\u4fee\u6539\u8fd9\u4e2a\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u6700\u540e\u8bbf\u95ee\u65f6\u95f4\uff08atime\uff09<\/td>\n<\/tr>\n \n b<\/td>\n \u4e0d\u518d\u4fee\u6539\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u5b58\u53d6\u65f6\u95f4<\/td>\n<\/tr>\n \n D<\/td>\n \u68c0\u67e5\u538b\u7f29\u6587\u4ef6\u4e2d\u7684\u9519\u8bef<\/td>\n<\/tr>\n \n d<\/td>\n \u4f7f\u7528dump\u547d\u4ee4\u5907\u4efd\u65f6\u5ffd\u7565\u672c\u6587\u4ef6\/\u76ee\u5f55<\/td>\n<\/tr>\n \n c<\/td>\n \u9ed8\u8ba4\u5c06\u6587\u4ef6\u6216\u76ee\u5f55\u8fdb\u884c\u538b\u7f29<\/td>\n<\/tr>\n \n u<\/td>\n \u5f53\u5220\u9664\u8be5\u6587\u4ef6\u540e\u4f9d\u7136\u4fdd\u7559\u5176\u5728\u786c\u76d8\u4e2d\u7684\u6570\u636e\uff0c\u65b9\u4fbf\u65e5\u540e\u6062\u590d<\/td>\n<\/tr>\n \n t<\/td>\n \u8ba9\u6587\u4ef6\u7cfb\u7edf\u652f\u6301\u5c3e\u90e8\u5408\u5e76\uff08tail-merging\uff09<\/td>\n<\/tr>\n \n x<\/td>\n \u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u538b\u7f29\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n [root@linuxprobe ~]# echo \"for Test\" > linuxprobe\r\n[root@linuxprobe ~]# rm linuxprobe\r\nrm: remove regular file \u2018linuxprobe\u2019? y\r\n<\/pre>\n
[root@linuxprobe ~]# echo \"for Test\" > linuxprobe\r\n[root@linuxprobe ~]# chattr +a linuxprobe\r\n[root@linuxprobe ~]# rm linuxprobe\r\nrm: remove regular file \u2018linuxprobe\u2019? y\r\nrm: cannot remove \u2018linuxprobe\u2019: Operation not permitted<\/pre>\n
[root@linuxprobe ~]# ls -al linuxprobe\r\n-rw-r--r--. 1 root root 9 Feb 12 11:42 linuxprobe<\/pre>\n
[root@linuxprobe ~]# lsattr linuxprobe\r\n-----a<\/strong>---------- linuxprobe\r\n[root@linuxprobe ~]# chattr -a linuxprobe\r\n[root@linuxprobe ~]# lsattr linuxprobe \r\n---------------- linuxprobe\r\n[root@linuxprobe ~]# rm linuxprobe \r\nrm: remove regular file \u2018linuxprobe\u2019? y\r\n<\/pre>\n