¡¦E̥桼¥¶¡¼¤¡¦oot¸¢¸Â¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¡¦Eˤ¡¦/h3>
¥¹¥Ý¥ó¥µ¡¼¥É¡¦E󥡦/p>
¤¢¡¦E³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤¡¦EȤ¤Ë¤Î¤ß¡¡¦oot¸¢¸Â¤Î¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤¿¤¤¤È¤¤¤¦¡¦E礡¦¢¤ê¤Þ¤¹¡¡¦½¤Î¤è¤¦¤Ê¤È¤¤Ë¤Ï¡¡¦udo¥³¥Þ¥ó¥É¤ò»È¤¦¤ÈÊØÍø¤Ç¤¹¡£
sudo¥³¥Þ¥ó¥É¤Î°ú¿ô¤Ë¼Â¹Ô¤·¤¿¤¤¥³¥Þ¥ó¥É¤ò»ØÄꤷ¤Æ¼Â¹Ô¤¹¡¦E³¤È¤Ç¡¡¦oot¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¡¦E³¤È¤¡¦Ç¤¤Þ¤¹¡¡¦·¤¡¦·¡¡¦udo¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¡¦Eݤˤϡ¢¤¢¤é¤¡¦¸¤¡¦Eetc/sudoers¥Õ¥¡¥¤¡¦E˼¹Ԥòµ¡¦Ä¤·¤¿¤¤¥æ¡¼¥¶¤òÀßÄꤷ¤Æ¤¡¦¡¦¡¦×¤¡¦¢¤ê¤Þ¤¹¡¡¦/p>
¤³¤Î/etc/sudoers¥Õ¥¡¥¤¡¦E˵½Ò¤¹¤¡¦E桼¥¶¡¼¤Ï¿¡¦ê¤Î¤¢¤¡¦E桼¥¶¡¼¤òÀßÄꤹ¤¡¦E¡¦×¤¡¦¢¤ê¤Þ¤¹¡¡¦/p>
¤Þ¤¿¡¢sudo¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤¿¡¦Á°¤Ïsyslog¥Ç¡¼¥â¥ó¤ò·Ðͳ¤·¤Æ¡¢¡¦Á°¥Õ¥¡¥¤¡¦E˵½Ò¤µ¤¡¦E¡¦EΤǡ¢¥»¥¥å¥¡¦EÆ¥£´ÉÍ¡¦å¤Î¥á¥¡¦EåȤ¡¦¢¤ê¤Þ¤¹¡£Ã¡¦¡¦¤¤Ä¤É¤ó¤Ê¥³¥Þ¥ó¥É¤¡¦udo¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤¿¤Î¤«¤ò¾Ü¤·¤¯ÃΡ¦E³¤È¤¡¦Ç¤¤Þ¤¹¡¡¦/p>
sudo -u <¥æ¡¼¥¶¡¼Ì¾> <¼Â¹Ô¤¹¡¦E³¥Þ¥ó¥¡¦
¡¦E̥桼¥¶¡¼¤¡¦oot¸¢¸Â¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¡¦Eˤ¡¦/strong>
[pakira@tiger pakira]$ su -
Password:
[root@tiger root]# visudo ¢«/etc/sudoers¥Õ¥¡¥¤¡¦EòÊÔ½¸¤¹¤¡¦E³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡¡¦/em>
------------------------------------------------------------
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
pakira ALL=(ALL) ALL ¢«µö²Ä¤·¤¿¤¤¥æ¡¼¥¶¡¼Ì¾¤òÄɲä·¤Þ¤¹¡£
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
------------------------------------------------------------
:wq¤ÇÊݸ½ªÎ»¤·¤Þ¤¹¡£
sudo¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¤ß¡¦E/strong>
[pakira@tiger pakira]$ sudo su - ¢«¡¦E̥桼¥¶¡¼¤¡¦u¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
Password: ¢«¡¦E̥桼¥¶¡¼¤Î¥Ñ¥¹¥¡¦E¼¥É¤òÆ¡¦Ï¤·¤Þ¤¹¡¡¦/em>
[root@tiger root]#¡¡¡¡¡¡¢«root¸¢¸Â¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¦Á°¤ò³Îǧ¤¹¡¦E/strong>
[root@tiger root]# tail /var/log/messages
Oct 4 10:53:45 tiger iptables: Flushing all current rules and user defined chains: succeeded
Oct 4 10:53:45 tiger iptables: Clearing all current rules and user defined chains: succeeded
Oct 4 10:53:45 tiger iptables: Flushing all current rules and user defined chains: succeeded
Oct 4 10:53:45 tiger iptables: Clearing all current rules and user defined chains: succeeded
Oct 4 10:53:45 tiger iptables: Applying iptables firewall rules succeeded
Oct 4 10:55:23 tiger sudo: pakira : user NOT in sudoers ; TTY=pts/0 ; PWD=/home/pakira ; USER=pakira ; COMMAND=adduser
Oct 4 11:01:36 tiger su(pam_unix)[1335]: session opened for user root by pakira(uid=500)
Oct 4 11:06:40 tiger su(pam_unix)[1335]: session closed for user root
Oct 4 11:06:48 tiger sudo: pakira : TTY=pts/0 ; PWD=/home/pakira ; USER=root ; COMMAND=/bin/su -
Oct 4 11:06:48 tiger su(pam_unix)[1369]: session opened for user root by pakira(uid=0)
¢£CentOS6.3¥µ¡¼¥Ð¡¼¹½Ãۥޥ˥奢¡¦Eò̵ÎÁ¥×¥¡¦E¼¥ó¥¡¦/strong>
¡¡¡¡CenOS6.3¤Î¥µ¡¼¥Ð¡¼¹½ÃÛ¡¦Eç¡¡¦Mware Player4¤Î
¡¡¡¡¥À¥¦¥ó¡¦½¼¥É¤È¥¤¥ó¥¹¥È¡¼¡¦E¡¦Eç¤ò¤Þ¤È¤á¤¿¥Þ¥Ë¥å¥¢¥¡¦E¡¦Ebr>
¡¡¡¡ÌµÎÁ¤Ç¥×¡¦E¼¥ó¥È¤·¤Æ¤¤¤Þ¤¹¡¡¦/b>
¡¡¡¡¾Ü¤·¤¯¤Ï¢¤Î¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤Þ¤¹¡£º£¤¹¤°¥¯¡¦EÃ¥¡¦·¤Æ¥À¥¦¥ó¥ú½¼¥É¤·¤Æ¤¡¦À¤µ¤¤¡¡¦br>
¡¡¡¡CentOS6.3¥µ¡¼¥Ð¡¼¹½Ãۥޥ˥奢¡¦Eò´¡¦EÖ¸ÂÄ¡¦E×¥¡¦E¼¥ó¥¡¦/a>
¥¹¥Ý¥ó¥µ¡¼¥É¡¦E󥡦/p>
[ ¥æ¡¼¥¶¡¼´ÉÍý ]
LinuxºÇ¶¯Tips½¸¡§Åö¥µ¥¤¥È¤Ë¤Ä¤¤¤Æ
- LinuxºÇ¶¯Tips½¸¤Ï¸Ä¿Í¤Ç±¿±Ä¤·¤Æ¤¤¡¦Eµ¥¤¥È¤Ç¤¹¡¡¦/li>
- ¤´°Õ¸«¡¢¤´¼ÁÌä¤Ï¥á¡¼¡¦EǤ¡¦ê¤¤¤¤¤¿¤·¤Þ¤¹¡¡¦/li>
¥¹¥Ý¥ó¥µ¡¼¥É¡¦E󥡦/p>
¤¢¡¦E³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤¡¦EȤ¤Ë¤Î¤ß¡¡¦oot¸¢¸Â¤Î¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤¿¤¤¤È¤¤¤¦¡¦E礡¦¢¤ê¤Þ¤¹¡¡¦½¤Î¤è¤¦¤Ê¤È¤¤Ë¤Ï¡¡¦udo¥³¥Þ¥ó¥É¤ò»È¤¦¤ÈÊØÍø¤Ç¤¹¡£
sudo¥³¥Þ¥ó¥É¤Î°ú¿ô¤Ë¼Â¹Ô¤·¤¿¤¤¥³¥Þ¥ó¥É¤ò»ØÄꤷ¤Æ¼Â¹Ô¤¹¡¦E³¤È¤Ç¡¡¦oot¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¡¦E³¤È¤¡¦Ç¤¤Þ¤¹¡¡¦·¤¡¦·¡¡¦udo¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¡¦Eݤˤϡ¢¤¢¤é¤¡¦¸¤¡¦Eetc/sudoers¥Õ¥¡¥¤¡¦E˼¹Ԥòµ¡¦Ä¤·¤¿¤¤¥æ¡¼¥¶¤òÀßÄꤷ¤Æ¤¡¦¡¦¡¦×¤¡¦¢¤ê¤Þ¤¹¡¡¦/p>
¤³¤Î/etc/sudoers¥Õ¥¡¥¤¡¦E˵½Ò¤¹¤¡¦E桼¥¶¡¼¤Ï¿¡¦ê¤Î¤¢¤¡¦E桼¥¶¡¼¤òÀßÄꤹ¤¡¦E¡¦×¤¡¦¢¤ê¤Þ¤¹¡¡¦/p>
¤Þ¤¿¡¢sudo¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤¿¡¦Á°¤Ïsyslog¥Ç¡¼¥â¥ó¤ò·Ðͳ¤·¤Æ¡¢¡¦Á°¥Õ¥¡¥¤¡¦E˵½Ò¤µ¤¡¦E¡¦EΤǡ¢¥»¥¥å¥¡¦EÆ¥£´ÉÍ¡¦å¤Î¥á¥¡¦EåȤ¡¦¢¤ê¤Þ¤¹¡£Ã¡¦¡¦¤¤Ä¤É¤ó¤Ê¥³¥Þ¥ó¥É¤¡¦udo¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤¿¤Î¤«¤ò¾Ü¤·¤¯ÃΡ¦E³¤È¤¡¦Ç¤¤Þ¤¹¡¡¦/p>
sudo -u <¥æ¡¼¥¶¡¼Ì¾> <¼Â¹Ô¤¹¡¦E³¥Þ¥ó¥¡¦
¡¦E̥桼¥¶¡¼¤¡¦oot¸¢¸Â¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¡¦Eˤ¡¦/strong>
[pakira@tiger pakira]$ su -
Password:
[root@tiger root]# visudo ¢«/etc/sudoers¥Õ¥¡¥¤¡¦EòÊÔ½¸¤¹¤¡¦E³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡¡¦/em>
------------------------------------------------------------
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
pakira ALL=(ALL) ALL ¢«µö²Ä¤·¤¿¤¤¥æ¡¼¥¶¡¼Ì¾¤òÄɲä·¤Þ¤¹¡£
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
------------------------------------------------------------
:wq¤ÇÊݸ½ªÎ»¤·¤Þ¤¹¡£
sudo¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¤ß¡¦E/strong>
[pakira@tiger pakira]$ sudo su - ¢«¡¦E̥桼¥¶¡¼¤¡¦u¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
Password: ¢«¡¦E̥桼¥¶¡¼¤Î¥Ñ¥¹¥¡¦E¼¥É¤òÆ¡¦Ï¤·¤Þ¤¹¡¡¦/em>
[root@tiger root]#¡¡¡¡¡¡¢«root¸¢¸Â¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¦Á°¤ò³Îǧ¤¹¡¦E/strong>
[root@tiger root]# tail /var/log/messages
Oct 4 10:53:45 tiger iptables: Flushing all current rules and user defined chains: succeeded
Oct 4 10:53:45 tiger iptables: Clearing all current rules and user defined chains: succeeded
Oct 4 10:53:45 tiger iptables: Flushing all current rules and user defined chains: succeeded
Oct 4 10:53:45 tiger iptables: Clearing all current rules and user defined chains: succeeded
Oct 4 10:53:45 tiger iptables: Applying iptables firewall rules succeeded
Oct 4 10:55:23 tiger sudo: pakira : user NOT in sudoers ; TTY=pts/0 ; PWD=/home/pakira ; USER=pakira ; COMMAND=adduser
Oct 4 11:01:36 tiger su(pam_unix)[1335]: session opened for user root by pakira(uid=500)
Oct 4 11:06:40 tiger su(pam_unix)[1335]: session closed for user root
Oct 4 11:06:48 tiger sudo: pakira : TTY=pts/0 ; PWD=/home/pakira ; USER=root ; COMMAND=/bin/su -
Oct 4 11:06:48 tiger su(pam_unix)[1369]: session opened for user root by pakira(uid=0)
¡¡¡¡CenOS6.3¤Î¥µ¡¼¥Ð¡¼¹½ÃÛ¡¦Eç¡¡¦Mware Player4¤Î
¡¡¡¡¥À¥¦¥ó¡¦½¼¥É¤È¥¤¥ó¥¹¥È¡¼¡¦E¡¦Eç¤ò¤Þ¤È¤á¤¿¥Þ¥Ë¥å¥¢¥¡¦E¡¦Ebr> ¡¡¡¡ÌµÎÁ¤Ç¥×¡¦E¼¥ó¥È¤·¤Æ¤¤¤Þ¤¹¡¡¦/b>
¡¡¡¡¾Ü¤·¤¯¤Ï¢¤Î¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤Þ¤¹¡£º£¤¹¤°¥¯¡¦EÃ¥¡¦·¤Æ¥À¥¦¥ó¥ú½¼¥É¤·¤Æ¤¡¦À¤µ¤¤¡¡¦br> ¡¡¡¡CentOS6.3¥µ¡¼¥Ð¡¼¹½Ãۥޥ˥奢¡¦Eò´¡¦EÖ¸ÂÄ¡¦E×¥¡¦E¼¥ó¥¡¦/a>
¥¹¥Ý¥ó¥µ¡¼¥É¡¦E󥡦/p>
LinuxºÇ¶¯Tips½¸¡§Åö¥µ¥¤¥È¤Ë¤Ä¤¤¤Æ
- LinuxºÇ¶¯Tips½¸¤Ï¸Ä¿Í¤Ç±¿±Ä¤·¤Æ¤¤¡¦Eµ¥¤¥È¤Ç¤¹¡¡¦/li>
- ¤´°Õ¸«¡¢¤´¼ÁÌä¤Ï¥á¡¼¡¦EǤ¡¦ê¤¤¤¤¤¿¤·¤Þ¤¹¡¡¦/li>