{"id":35,"date":"2019-03-15T05:12:08","date_gmt":"2019-03-15T05:12:08","guid":{"rendered":"http:\/\/pro369.com\/linux\/?p=35"},"modified":"2019-03-15T05:12:08","modified_gmt":"2019-03-15T05:12:08","slug":"linux%e4%b8%bb%e6%a9%9f%e4%bc%ba%e6%9c%8d%e5%99%a8%e6%9e%b6%e8%a8%ad%e6%8a%80%e8%a1%93%ef%bc%88%e4%bd%bf%e7%94%a8%e8%80%85%e6%93%81%e6%9c%89%e6%ac%8a%e5%be%a9%e5%8e%9f-home-chowner%ef%bc%89","status":"publish","type":"post","link":"https:\/\/por.tw\/linux\/linux%e4%b8%bb%e6%a9%9f%e4%bc%ba%e6%9c%8d%e5%99%a8%e6%9e%b6%e8%a8%ad%e6%8a%80%e8%a1%93%ef%bc%88%e4%bd%bf%e7%94%a8%e8%80%85%e6%93%81%e6%9c%89%e6%ac%8a%e5%be%a9%e5%8e%9f-home-chowner%ef%bc%89\/","title":{"rendered":"Linux\u4e3b\u6a5f\u4f3a\u670d\u5668\u67b6\u8a2d\u6280\u8853\uff08\u4f7f\u7528\u8005\u64c1\u6709\u6b0a\u5fa9\u539f Home chowner\uff09"},"content":{"rendered":"<p><span style=\"background-color: #ffff00; font-size: medium;\"><strong>Linux\u4e3b\u6a5f\u4f3a\u670d\u5668\u67b6\u8a2d\u6280\u8853\uff08\u4f7f\u7528\u8005\u64c1\u6709\u6b0a\u5fa9\u539f Home chowner\uff09<\/strong><\/span><\/p>\n<p>\u82e5\u4ee5 root \u8eab\u4efd\u57f7\u884c sftp \u628a \/home \u4e0b\u6240\u6709\u3000user \u8cc7\u6599\u593e\u53d6\u56de\uff0c\u5168\u90e8\u8cc7\u6599\u593e\u6a94\u6848\u8eab\u4efd\u6b0a\u9650\u7686\u6210\u70ba root\u3002<\/p>\n<p>\u89e3\u6c7a\u65b9\u5f0f\uff1a<\/p>\n<p>1. \u4f7f\u7528 chown \u6307\u4ee4\u4e00\u500b\u4e00\u500b\u8b8a\u66f4 \u2192 \u9f90\u5927\u7684\u5de5\u7a0b\u3002<br \/>\n2. \u4f7f\u7528 shell\uff0c\u4e00\u6b21\u628a \/home \u5e95\u4e0b\u6240\u6709\u7684\u8cc7\u6599\u593e\uff0c\u6062\u5fa9\u6210\u539f\u6709\u7684\u4eba\u3002<\/p>\n<p>\u82e5\u914d\u5408\u4e3b\u6a5f\u79fb\u8f49\u6587\u4ef6\uff0c\u76f4\u63a5\u628a \/etc\/passwd\uff0c\/etc\/shadow, \/etc\/group \u8cc7\u6599\u76f4\u63a5\u8f49\u81f3\u65b0\u4e3b\u6a5f\uff0c\u90a3\u9ebc\u4e3b\u6a5f\u79fb\u8f49\u5de5\u4f5c\u5c31\u8b8a\u6210\u5f88\u5feb\u901f\u7684\u4e00\u4ef6\u4e8b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/visdacom.com\/linux\/wp-content\/uploads\/2019\/03\/Linux-Server-Project-11-650x433.jpg\" alt=\"\" class=\"alignnone size-medium wp-image-499\" width=\"650\" height=\"433\" \/><\/p>\n<p>SHELL\u5167\u5bb9<\/p>\n<p>\u6ce8\u610f\uff1a\u672c shell \u5beb\u7684\u4e0d\u592a\u597d\uff0c\u53ea\u80fd\u653e\u5728 \/home \u5e95\u4e0b\u57f7\u884c\uff0c\u505a\u6cd5\u5982\u4e0b<\/p>\n<p>* root@dns:\/home$ vi \/home\/chownall.sh<\/p>\n<p>#!\/bin\/bash<br \/>\nfnames=$(ls \/home)<br \/>\nfor i in $fnames<br \/>\ndo<br \/>\nif [ -d $i ]; then<br \/>\nchown -R $i.$i \/home\/$i<br \/>\nfi<br \/>\ndone<\/p>\n<p>* root@dns:\/home$ sh chownall.sh<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u4e3b\u6a5f\u4f3a\u670d\u5668\u67b6\u8a2d\u6280\u8853\uff08\u4f7f\u7528\u8005\u64c1\u6709\u6b0a\u5fa9\u539f Home chowner\uff09 \u82e5\u4ee5 root \u8eab\u4efd\u57f7\u884c sftp [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":499,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[20],"class_list":["post-35","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-","tag-linux"],"_links":{"self":[{"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/posts\/35"}],"collection":[{"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/comments?post=35"}],"version-history":[{"count":0,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/posts\/35\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/media\/499"}],"wp:attachment":[{"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/media?parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/categories?post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/por.tw\/linux\/wp-json\/wp\/v2\/tags?post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}