Debian10中sudo配置

Debian10中/etc/sudoers中提示了需要通过visudo来编辑该文件,如下:

This file MUST be edited with the ‘visudo’ command as root.

但奇葩的是系统中没有visudo命令,apt搜索也搜不到,-_-!

然后通过su切换至root用户,直接vi编辑/etc/sudoers也不可以,提示只读文件,我勒个去! root权限还不够!这有点扯淡了

$su
#vi /etc/sudoers

readonly file

想了下最后找到了如下办法,将要写的内容写入到/etc/sudoers中了。

#echo "alair  ALL=(ALL:ALL) ALL" >> /etc/sudoers

保存后用户alair就可以使用sudo命令来进行root权限操作了。