netctl start 要求输入 root 密码

Mic*_*rst 5 networking linux passwords

每次我这样做netctl start NewtonNewton是我的 wifi 网络配置文件的名称)时,我都会收到以下消息:

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or other units.
Authenticating as: root
Password:
Run Code Online (Sandbox Code Playgroud)

如果我输入错误的密码,我会收到以下消息:

==== AUTHENTICATION FAILED ===
Failed to start netctl@Newton.service: Access denied
Run Code Online (Sandbox Code Playgroud)

这对我来说实际上不是问题,因为我知道我的 root 密码,但让我震惊的是,如果我不知道,我将无法连接到互联网,这是不对的。我是一个 sudoer,所以我应该能够使用我自己的密码连接到网络,但它需要 root 的密码。

如何让它停止询问 root 密码?

Mic*_*rst 9

所以我被要求输入 root 密码的原因是因为我没有使用 sudo 运行命令。如果我这样做,它不会要求输入密码。


Ale*_*lex 0

尝试一下visudo

user host= NOPASSWD: /usr/bin/netctl
Run Code Online (Sandbox Code Playgroud)

使用绝对路径!