{"id":8793,"date":"2023-02-03T06:56:17","date_gmt":"2023-02-02T21:56:17","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=8793"},"modified":"2023-02-13T19:47:55","modified_gmt":"2023-02-13T10:47:55","slug":"linux%e3%81%a7%e3%83%87%e3%82%a3%e3%83%ac%e3%82%af%e3%83%88%e3%83%aa%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-%ef%bd%87s%ef%bc%89","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/8793","title":{"rendered":"Linux\u3067\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5bfe\u3057\u3066SGID\u3092\u8a2d\u5b9a\u3059\u308b\uff01\uff08chmod g+s\uff09"},"content":{"rendered":"<p>Linux\u3067\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5bfe\u3057\u3066SGID\u3092\u8a2d\u5b9a\u3057\u3066\u3001\u914d\u4e0b\u306b\u4f5c\u6210\u3055\u308c\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3084\u30d5\u30a1\u30a4\u30eb\u306e\u30b0\u30eb\u30fc\u30d7\u304c\u7d99\u627f\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>SGID\u3092\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5bfe\u3057\u3066\u4ed8\u4e0e\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3092\u78ba\u8a8d\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;\u30c7\u30a3\u30ec\u30af\u30c8\u30ea]\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;\u30c7\u30a3\u30ec\u30af\u30c8\u30ea]\r\n<\/pre>\n<h2>SGID\u3092\u4ed8\u4e0e\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>SGID\u306e\u52d5\u4f5c\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u3001SGID\u3092\u4ed8\u4e0e\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,3,4,6,7]; title: ; notranslate\" title=\"\">\r\n$ id\r\nuid=1000(usradmin) gid=1000(usradmin) groups=1000(usradmin),10(wheel) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023\r\n$ mkdir \/tmp\/test\r\n$ chmod 2000 \/tmptest\r\nchmod: cannot access '\/tmptest': No such file or directory\r\n$ chmod 2000 \/tmp\/test\r\n$ ls -ld \/tmp\/test\r\nd-----S---. 2 usradmin usradmin 6 Feb  1 06:55 \/tmp\/test\r\n<\/pre>\n<h2>\u4ed6\u306e\u30e6\u30fc\u30b6\u3067SGID\u306e\u8a2d\u5b9a\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>root\u30e6\u30fc\u30b6\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002root\u30e6\u30fc\u30b6\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u305f\u306e\u306b\u3082\u304b\u304b\u308f\u3089\u305a\u3001\u30b0\u30eb\u30fc\u30d7\u306f\u300croot\u300d\u3067\u306a\u304f\u300cusradimin\u300d\u306b\u306a\u308a\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30b0\u30eb\u30fc\u30d7\u304c\u7d99\u627f\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,3,4]; title: ; notranslate\" title=\"\">\r\n\uff03 id\r\nuid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023\r\n# touch \/tmp\/test\/sgidtest\r\n# ls -ld \/tmp\/test\/sgidtest \r\n-rw-r--r--. 1 root usradmin 0 Feb  1 06:56 \/tmp\/test\/sgidtest\r\n<\/pre>\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\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u691c\u7d22\u3057\u3066\u307f\u307e\u3059\u3002journal\u30ed\u30b0\u306b\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo find \/ -perm -2000 -type d | xargs ls -ld\r\n...\r\ndrwxr-sr-x. 3 root     systemd-journal 60 Jan 30 19:42 \/run\/log\/journal\r\ndrwxr-s---+ 2 root     systemd-journal 60 Jan 30 19:42 \/run\/log\/journal\/47755988a6524804831f1f1ae20426dc\r\nd-----S---. 2 usradmin usradmin        22 Feb  1 06:56 \/tmp\/test\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>SGID\u306f\u3001root\u306a\u3069\u4ed6\u306e\u30b0\u30eb\u30fc\u30d7\u306e\u30e6\u30fc\u30b6\u304c\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3084\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306b\u3001\u89aa\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3084\u30d5\u30a1\u30a4\u30eb\u306e\u30b0\u30eb\u30fc\u30d7\u3092\u7d99\u627f\u3057\u305f\u3044\u5834\u5408\u306b\u4f7f\u7528\u3057\u307e\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\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u5bfe\u3057\u3066SGID\u3092\u8a2d\u5b9a\u3057\u3066\u3001\u914d\u4e0b\u306b\u4f5c\u6210\u3055\u308c\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3084\u30d5\u30a1\u30a4\u30eb\u306e\u30b0\u30eb\u30fc\u30d7\u304c\u7d99\u627f\u3055\u308c\u308b\u3088\u3046\u306b\u3057\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":[188],"tags":[],"class_list":["post-8793","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-account"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/8793","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=8793"}],"version-history":[{"count":0,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/8793\/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=8793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=8793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=8793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}