Linuxでsudoの基本知識まとめ

1.操作コマンド:
[root@ocm1 ~]# rpm -qa|grep sudo
sudo-1.6.9p17-5.el5
[root@ocm1 ~]# visudo rootで/etc/sudoersを開く
root ALL=(ALL) ALL
oracle ALL=(ALL) ALL ,
sudo vi /etc/hosts   保存
2.エラー問題の解決
2.1 メッセージ:Sorry, user test is not allowed to execute '/bin/cat /etc/sudoers’ as root on
localhost.localdomain.

解決方法:
test localhost=/sbin/cat /etc/sudoers
Defaults@localhost log_host /var/log/sudo.log

2.2:[jackyu@localhost jackyu]$ sudo cat /etc/sudoers
Sorry, user jackyu is not allowed to execute '/bin/cat /etc/sudoers’ as root on
localhost.localdomain.

操作コマンド:
sudo cat -n /etc/sudoers

Linux

Posted by arkgame