{"id":10,"date":"2013-07-12T00:55:40","date_gmt":"2013-07-11T15:55:40","guid":{"rendered":"https:\/\/www.dogrow.net\/linux\/?p=10"},"modified":"2022-07-17T04:16:28","modified_gmt":"2022-07-16T19:16:28","slug":"blog2","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/linux\/blog2\/","title":{"rendered":"(2) sudo\u30e6\u30fc\u30b6\u30fc\u306e\u8ffd\u52a0"},"content":{"rendered":"<h1 class=\"my_h\">1. \u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u975eroot\u306e\u30e6\u30fc\u30b6\u30fc\u3067 <span class=\"my_fc_deeppinkB\">sudo<\/span> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u305f\u3044\u3002<\/p>\n<h1 class=\"my_h\">2. \u3084\u3063\u3066\u307f\u308b<\/h1>\n<h2 class=\"my_h\">\u65b9\u6cd51 : \u30e6\u30fc\u30b6\u30fc\u3092 wheel\u30b0\u30eb\u30fc\u30d7\u306b\u5165\u308c\u308b\u3002<\/h2>\n<p><span class=\"my_fc_greenB\">wheel<\/span> \u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306f\u3001root\u6a29\u9650\u306e\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u308b\u3002<br \/>\n\u3053\u3053\u3067\u306f\u3001<span class=\"my_fc_deeppinkB\">usermod<\/span> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066\u3001\u30e6\u30fc\u30b6\u30fc <span class=\"my_fc_blueB\">hoge<\/span> \u3092 <span class=\"my_fc_greenB\">wheel<\/span> \u30b0\u30eb\u30fc\u30d7\u306b\u8ffd\u52a0\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"my_pre\">\r\n[root@]# <span class=\"my_fc_deeppinkB\">usermod<\/span> -aG <span class=\"my_fc_greenB\">wheel<\/span> <span class=\"my_fc_blueB\">hoge<\/span>\r\n<\/pre>\n<p><span class=\"my_fc_deeppinkB\">id<\/span> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066\u300c\u6240\u5c5e\u30b0\u30eb\u30fc\u30d7\u3092\u8ffd\u52a0\u3067\u304d\u305f\u304b\uff1f\u300d\u3092\u78ba\u8a8d\u3059\u308b\u3002 \u2192 OK\u3060\uff01<\/p>\n<pre class=\"my_pre\">\r\n[root@]# <span class=\"my_fc_deeppinkB\">id<\/span> <span class=\"my_fc_blueB\">hoge<\/span>\r\n\r\nuid=1000(dog) gid=1000(dog) groups=1000(hoge),10(wheel)\r\n<\/pre>\n<h2 class=\"my_h\">\u65b9\u6cd52 : visudo\u3067\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u8a18\u3059\u308b\u3002<\/h2>\n<p>\u30101\/3\u3011\u7ba1\u7406\u8005\u6a29\u9650\u3067 <span class=\"my_fc_deeppinkB\">visudo<\/span> \u3092\u8d77\u52d5\u3059\u308b\u3002<\/p>\n<pre class=\"my_pre\">\r\n[hoge@]$ su -\r\nPassword:\r\n[root@]# visudo\r\n<\/pre>\n<p>\u3059\u308b\u3068 <span class=\"my_fc_blueB\">\/etc\/sudoers<\/span> \u306e\u7de8\u96c6\u304c\u59cb\u307e\u308b\u3002<\/p>\n<p>\u30102\/3\u3011\u300cAllow root to run any commands anywhere\u300d\u306e\u4e0b\u306b\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"my_pre\">\r\n## Next comes the main part: which users can run what software on\r\n## which machines (the sudoers file can be shared between multiple\r\n## systems).\r\n## Syntax:\r\n##\r\n##      user    MACHINE=COMMANDS\r\n##\r\n## The COMMANDS section may have other options added to it.\r\n##\r\n## Allow root to run any commands anywhere\r\nroot    ALL=(ALL)       ALL\r\n<span class=\"my_fc_deeppinkB\">hoge    ALL=(ALL)       ALL<\/span>\r\n<\/pre>\n<p>\u7de8\u96c6\u3057\u305f\u3089\u4fdd\u5b58\uff06\u7d42\u4e86\u3059\u308b\u3002<\/p>\n<p>\u300c\u6240\u5c5e\u30b0\u30eb\u30fc\u30d7\u3092\u8ffd\u52a0\u3067\u304d\u305f\u304b\uff1f\u300d\u3092\u78ba\u8a8d\u3059\u308b\u3002 \u2192 OK\u3060\uff01<\/p>\n<pre class=\"my_pre\">\r\n[root@]# id <span class=\"my_fc_blueB\">hoge<\/span>\r\n\r\nuid=1000(dog) gid=1000(dog) groups=1000(hoge),10(wheel)\r\n<\/pre>\n<h1 class=\"my_h\">3. \u304a\u307e\u3051 : \u52d5\u4f5c\u78ba\u8a8d<\/h1>\n<p>\u78ba\u8a8d\u306e\u305f\u3081\u306b\u30e6\u30fc\u30b6\u30fc\u540d hoge \u3067 yum install \u3092\u5b9f\u884c\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"my_pre\">\r\n[hoge@]$ sudo yum -y install gnuplot\r\n[sudo] password for hoge:\r\nLoaded plugins: fastestmirror, refresh-packagekit, security\r\nLoading mirror speeds from cached hostfile\r\n...\r\n<\/pre>\n<p>\u7ba1\u7406\u8005\u6a29\u9650\u3067\u3057\u304b\u5b9f\u884c\u3067\u304d\u306a\u3044\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3067\u304d\u305f\u3002\u2192 OK\uff01<\/p>\n<hr class=\"my_hr_bottom\">\n","protected":false},"excerpt":{"rendered":"<p>1. \u3084\u308a\u305f\u3044\u3053\u3068 \u975eroot\u306e\u30e6\u30fc\u30b6\u30fc\u3067 sudo \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u305f\u3044\u3002 2. \u3084\u3063\u3066\u307f\u308b \u65b9\u6cd51 : \u30e6\u30fc\u30b6\u30fc\u3092 wheel\u30b0\u30eb\u30fc\u30d7\u306b\u5165\u308c\u308b\u3002 wheel \u30b0\u30eb\u30fc\u30d7\u306b\u5c5e\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306f\u3001root\u6a29\u9650\u306e\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/linux\/blog2\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,3,6],"tags":[],"class_list":["post-10","post","type-post","status-publish","format-standard","hentry","category-visudo","category-command","category-6"],"views":2933,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts\/10","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":19,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts\/10\/revisions"}],"predecessor-version":[{"id":3481,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/posts\/10\/revisions\/3481"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/media?parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/categories?post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/linux\/wp-json\/wp\/v2\/tags?post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}