Fork me on GitHub
瞬间的惊奇真是种确幸,每种确幸都是支玄妙的俳句。吊桥抬起,退回到内心幽静的花园,邂逅的还是那种熟悉的冷冷清清又轰轰烈烈的美妙质感。这真令人欢喜。

sudo命令详解

sudo实验:
开启sudo日志
[root@localhost ~]# visudo
# Defaults specification
Defaults logfile = "/var/log/sudo"
设置权限
[root@localhost ~]# visudo
# %users localhost=/sbin/shutdown -h now
lisi localhost=/bin/ping
han localhost=!/bin/ping
测试:
[han@localhost ~]$ sudo ping 192.168.56.200 失败
[lisi@localhost ~]$ sudo ping 192.168.56.200 成功
[root@localhost ~]# tail /var/log/sudo //查看日志
Sep 24 00:39:02 : han : command not allowed ; TTY=pts/0 ; PWD=/home/han ;
USER=root ; COMMAND=/bin/ping 192.168.56.200
Sep 24 00:39:18 : lisi : TTY=pts/0 ; PWD=/home/lisi ; USER=root ;
COMMAND=/bin/ping 192.168.56.200

 

posted @ 2018-10-01 10:58  干嘛那么贪睡  阅读(356)  评论(0编辑  收藏  举报