{"id":8779,"date":"2023-02-02T21:16:13","date_gmt":"2023-02-02T12:16:13","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=8779"},"modified":"2023-02-13T19:47:32","modified_gmt":"2023-02-13T10:47:32","slug":"linux%e3%81%a7%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ab%e5%af%be%e3%81%97%e3%81%a6sgid%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b%ef%bc%81%ef%bc%88chmod-us","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/8779","title":{"rendered":"Linux\u3067\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066SGID\u3092\u8a2d\u5b9a\u3059\u308b\uff01\uff08chmod g+s\uff09"},"content":{"rendered":"<p>Linux\u3067\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066SGID\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002SGID\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb\u306e\u30b0\u30eb\u30fc\u30d7\u306e\u6a29\u9650\u304c\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>SGID\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u7d22\u3059\u308b\uff01<\/h2>\n<p>SGID\u306f\u3042\u307e\u308a\u4f7f\u7528\u3055\u308c\u306a\u3044\u6a29\u9650\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u30b3\u30de\u30f3\u30c9\u3092\u63a2\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo find \/ -perm -2000 -type f | xargs ls -ld\r\n...\r\n-rwx--s--x. 1 root slocate   47128 Aug 13  2018 \/usr\/bin\/locate\r\n-rwxr-sr-x. 1 root tty       21280 Jan 19  2021 \/usr\/bin\/write\r\n-r-xr-sr-x. 1 root ssh_keys 455072 Apr 14  2021 \/usr\/libexec\/openssh\/ssh-keysign\r\n-rwx--s--x. 1 root utmp      13096 Aug 12  2018 \/usr\/libexec\/utempter\/utempter\r\n-rwx--s--x. 1 root lock      21512 Aug 12  2018 \/usr\/sbin\/lockdev\r\n<\/pre>\n<p>locate\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u691c\u7d22\u306eDB\u3092\u53c2\u7167\u3059\u308b\u305f\u3081\u306bSGID\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo ls -l \/var\/lib\/mlocate\r\ntotal 3140\r\n-rw-r-----. 1 root slocate 3211571 Jan 31 00:00 mlocate.db\r\n&#x5B;usradmin@vmsrhe05 ~]$ sudo ls -l \/var\/lib\/mlocate\r\n<\/pre>\n<p>\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u3067\u30e6\u30fc\u30b6\u304c\u5171\u6709\u3059\u308b\u8cc7\u6e90\u3092\u4f7f\u7528\u3057\u305f\u3044\u5834\u5408\u306b\u3001SGID\u3092\u4f7f\u7528\u3057\u307e\u3059\u304c\u3001\u4f7f\u7528\u3059\u308b\u6a5f\u4f1a\u306f\u591a\u304f\u306a\u3055\u305d\u3046\u3067\u3059\u3002<\/p>\n<h2>SGID\u3092\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066\u4ed8\u4e0e\u3059\u308b\uff01<\/h2>\n<p>SUID\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u4ed8\u4e0e\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo chmod g+s &#x5B;\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb]\r\n<\/pre>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3082\u540c\u3058\u3088\u3046\u306bSGID\u3092\u4ed8\u4e0e\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo chmod 2000 &#x5B;\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb]\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>SGID\u306f\u30b0\u30eb\u30fc\u30d7\u306e\u6a29\u9650\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u3001\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u306a\u30d5\u30a1\u30a4\u30eb\u304c\u591a\u304f\u306a\u308a\u305d\u3046\u3067\u3059\u304c\u3001SGID\u304c\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30b3\u30de\u30f3\u30c9\u306e\u30b0\u30eb\u30fc\u30d7\u3068\u540c\u3058\u30b0\u30eb\u30fc\u30d7\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u307b\u3068\u3093\u3069\u306a\u304f\u3001\u4f7f\u7528\u3059\u308b\u30b1\u30fc\u30b9\u306f\u9650\u3089\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/8020\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3067\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u30d5\u30a1\u30a4\u30eb\u3092\u64cd\u4f5c\u3059\u308b\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2021\/02\/fi_linux_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3067\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u30d5\u30a1\u30a4\u30eb\u3092\u64cd\u4f5c\u3059\u308b\uff01<\/div><div class=\"substr\">Linux\u3067\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u30d5\u30a1\u30a4\u30eb\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/7679\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2021\/02\/fi_linux_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01<\/div><div class=\"substr\">Linux\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<h2>\u95a2\u9023\u66f8\u7c4d\uff08Amazon\uff09<\/h2>\n<p><iframe sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-same-origin\" style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=infotecr-22&language=ja_JP&o=9&p=8&l=as4&m=amazon&f=ifr&ref=as_ss_li_til&asins=4774174041&linkId=1be31975ee817bf3bb17e2a366509519\"><\/iframe><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u3067\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066SGID\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002SGID\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb\u306e\u30b0\u30eb\u30fc\u30d7\u306e\u6a29\u9650\u304c\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":5527,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[201],"tags":[],"class_list":["post-8779","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-files"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/8779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=8779"}],"version-history":[{"count":0,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/8779\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/5527"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=8779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=8779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=8779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}