【linux】sudo不反解析主机名

centos环境
在使用sudo命令时,怎样不反解析主机名,这里在本机使用,反解析后导致sudo无法使用。
【linux】sudo不反解析主机名

回答

这应该只是个警告才对,不影响最后的结果。你是不是改过主机名?如果是的话,在/etc/hosts文件添加当前主机名的解析记录即可解决这个警告

并不是所有的用户都能以 Sudo 角色运行, 有可能是你的 sudoers 的配置文件有问题

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification

root ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges

%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command

%sudo ALL=(ALL:ALL) ALL

理论上应该是提示你输入当前用户密码,可能是你的hostname被改了?

以上是 【linux】sudo不反解析主机名 的全部内容, 来源链接: utcz.com/a/83461.html

回到顶部