Linux 基础命令 -- visudo

命令介绍

命令:visudo 编辑/etc/sudoers文件的专属命令

用法:visudo [-chqsV] [-f sudoers]

命令选项

[root@fp-21 ~]# visudo --help

  -c, --check              # 仅检查模式
  -f, --file=sudoers       # 指定sudoers文件位置
  -h, --help               # 帮助文档
  -q, --quiet              # 启用安静模式,此模式下不显示错误信息
  -s, --strict             # 启用严格检查sudoers文件
  -V, --version            # 版本信息

命令实例

# 编辑/etc/sudoers文件的专属命令
[root@fp-21 ~]# visudo
## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.
##
## Examples are provided at the bottom of the file for collections
## of related commands, which can then be delegated out to particular
## users or groups.
##
## This file must be edited with the 'visudo' command.
……

# 仅检查模式
[root@fp-21 ~]# visudo -c
/etc/sudoers: parsed OK

# 启用安静模式,此模式下不显示错误信息
[root@fp-21 ~]# visudo -q

## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.
##
## Examples are provided at the bottom of the file for collections
## of related commands, which can then be delegated out to particular
## users or groups.
##
## This file must be edited with the 'visudo' command.
……

# 启用严格检查sudoers文件
[root@fp-21 ~]# visudo -s
……
visudo: /etc/sudoers.tmp unchanged

link 查看 Linux 基础命令

只有注入思想的博客才是好的博客

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值