CentOS:sudo ãè¨å®ãã
以å㯠su ã§ã¦ã¼ã¶ã®å¶éããã¦ãã¾ããã
su ã³ãã³ãã§ã¯ rootã®ãã¹ã¯ã¼ããç´æ¥å
¥åããã®ã§
ã»ãã¥ããªãã£çã«ããå°ãé
æ
®ãã sudo ã«ã¦ root権éã«ã¦
ã³ãã³ããå®è¡ãããããã«ãã¾ãã
ã㦠sudoã®è¨å®ã§ãã次ã®ã¨ããã§ãã
sudoãinstallããã¦ããã確èªãã¾ããã
[aaa@localhost ~]$ yum list installed |grep sudo
sudo.i386 1.6.8p12-10 installed
[aaa@localhost ~]$
ããinstallããã¦ããªããã°ãrootã«ãªã次ã®ããã«installãã¾ãã
yum install sudo
sudoè¨å®ã¯ãsudoã³ãã³ãã®ãã«ãã§ç¢ºèªãã¾ã
[aaa@localhost ~]$ man sudo
ã³ãã³ãã®ä½¿ç¨æ¹æ³ã®èª¬æãããã¾ããæå¾ã®æ¹ã«
é¢é£é ç®
stat(2), login_cap(3), sudoers(5), passwd(5), visudo(8), grep(1),
su(1).
ãã®visudoã³ãã³ãã使ã£ã¦sudoã®è¨å®ãã¾ãã
visudo(/usr/sbin/visudo)ã使ããsudo ã§ããã¦ã¼ã¶ã /etc/sudoersã«è¨è¿°ãã¾ã
[root@localhost ~]# visudo
è¨è¿°ã¯ã¦ã¼ã¶ã¢ã«ã¦ã³ãæ¯ã«ãã°ã«ã¼ãæ¯ã«ãè¨å®ãã§ãã¾ãã
æ¸å¼ã¯ãã¦ã¼ã¶ã¢ã«ã¦ã³ãæ¯ã®å ´å
aaa ALL=(ALL) ALL
ã¦ã¼ã¶åãã©ããã=(sudoãããã¦ã¼ã¶å) å©ç¨ã§ããã³ãã³ãã®å¶é
ã°ã«ã¼ãã®å ´åã¯ãã°ã«ã¼ãåã®åã«%ãä»ãã¦è¨è¿°ãã¾ãã
%wheel ALL=(ALL) ALL
ããã§æ¬¡ã®ããã«è©¦ãã¦ã¿ã¾ãã
[aaa@localhost ~]$ ps -ef |grep httpd
aaa 4731 4712 0 19:43 pts/0 00:00:00 grep httpd
[aaa@localhost ~]$ cd /etc/init.d
[aaa@localhost init.d]$ ./httpd start
httpd ãèµ·åä¸: [失æ]
[aaa@localhost init.d]$ sudo ./httpd start
Password:<ããã«aaaã®ãã¹ã¯ã¼ããå ¥åãã>
httpd ãèµ·åä¸: [ OK ]
[aaa@localhost init.d]$
ããã§æ¬¡åãã sudo ã使ããããã«ãªãã¾ããã