Debian10中sudo配置

Jul 10, 2019 • 更新于 May 16, 2025

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

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

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

解决方法为,先使用su切换至root用户,然后apt install sudo安装sudo

然后编辑/etc/sudoers,加入以下内容,保存时使用wq!强制保存即可。

username ALL=(ALL:ALL) ALL

或者使用echo直接写入到/etc/sudoers中。

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

接下来就可以使用sudo命令来进行root权限操作了。

stuffDebianLinuxDebian10sudovisudosudoers奇葩

找回windows10照片查看器

Ubuntu/Widnows双系统时间不一致解决方法