当我做一些需要连续输入几十次 root 的事情时,我更喜欢将我的会话切换到 root 会话。在各种教程和说明我已经使用了互联网上,我看到了sudo su,sudo su -,sudo -i和sudo /bin/bash用来打开一个root会话,但我不会在这些当之间,或者说差异事项的区别清楚。
有人可以帮我解决这个问题吗?
ubuntuUbuntu Server 12.04 的 AWS 映像上的用户如何在sudo没有配置的情况下对所有命令设置无密码/etc/sudoers?
我在亚马逊上使用 Ubuntu 服务器 12.04。我想添加一个与默认 Ubuntu 用户具有相同行为的新用户。具体来说,我希望sudo这个新用户无密码。
所以我添加了一个新用户并开始编辑/etc/sudoers(当然使用 visudo)。通过阅读该文件,似乎默认ubuntu用户sudo从成为该admin组的成员中获得了无密码。所以我添加了我的新用户。这没有用。然后我尝试将NOPASSWD指令添加到sudoers. 这也不起作用。
无论如何,现在我只是好奇。怎样的ubuntu,如果他们没有在定义用户密码的获得特权/etc/sudoers。允许这样做的机制是什么?
在/etc/sudoers我看到这个:
# Allow members of group sudo to execute any command after they have
# provided their password
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL
Run Code Online (Sandbox Code Playgroud)
那么如何将用户添加到该sudo组?
我正在尝试在没有密码的情况下设置 sudo,但仍然提示我输入密码,我使用的是 ubuntu,这是 sudoers 配置文件中的相关行:
gandalf ALL=(ALL:ALL) NOPASSWD: ALL
Run Code Online (Sandbox Code Playgroud) 我正在尝试创建的键盘有很多 Unicode,看起来像这样:

以下教程不成功:
我想知道是否有人会提供更好的教程和分步说明?
以下是我的情况:
我绝对讨厌密码要求。如何禁用此要求,以便我的 Linux 计算机在这方面的行为更像 Windows?我不想听到我不应该这样做,因为它不安全。这是我的愿望,因此对安全的担忧实际上是无效的。
Ubuntu(或 Debian 衍生产品)通过禁用 root 用户获得的实际好处是什么?
在我读到的任何地方,它都说要防止没有经验的用户意外损坏。我想知道究竟是什么,因为sudo可以执行所有命令(我知道/使用)。
那么在什么情况下 root 可以造成损坏而sudo不能呢?
PS:我知道如何sudo运作。
每当我发出命令时,sudo apt-get install foo它都不会要求输入密码。是因为用户组吗?
如何让它提示输入密码?
编辑:我的 sudoers 文件
apple@Ascension:~$ sudo cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL …Run Code Online (Sandbox Code Playgroud) 每当我发出命令 sudo apt-get install **它不会要求输入密码,我的管理员用户也不会。
如何让它提示输入密码?
我的 sudoer :
ubuntu:~$ sudo cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root …Run Code Online (Sandbox Code Playgroud) 我为 gddccontrol 创建了一个桌面图标,但要运行它,我需要从 sudo 执行它。有没有办法从桌面图标运行命令,例如,
sudo -pPASSWORD gddccontrol
Run Code Online (Sandbox Code Playgroud)
所以它不会在终端中询问我的密码?
我只想点击并使用 sudo 权限运行它。
[Desktop Entry]
Type=Application
Name=GDDCControl
Terminal=false
Comment=gddccontrol ddccontrol
Exec=sudo -pPASSWORD gddccontrol
Icon=~/Pictures/10429.png
Run Code Online (Sandbox Code Playgroud)
当我使用以下 Exec 命令从终端运行图标时,它运行良好,但在启动器中不起作用:(
Exec=echo mypasswd | sudo -S gddccontrol
Run Code Online (Sandbox Code Playgroud) 我的 eth0 使用 DHCP 来获取互联网的 IP 地址。但是我仍然需要为我的 LAN 设置一些静态 IP。以下是我在 /etc/network/interface 中的设置。剧本有问题吗?当我尝试启动网络时,我总是失败。
我通过ifconfig检查了IP。发现 eth0:3 已设置,但其他。我可以知道有什么问题吗?
1 auto lo
2 iface lo inet loopback
3
4 #auto eth0
5 #iface eth0 inet dhcp
6
7 auto eth0:1
8 iface eth0:1 inet static
9 address 192.168.20.222
10 netmask 255.255.255.0
11 gateway 192.168.20.1
12
13 auto eth0:2
14 iface eth0:2 inet static
15 address 192.168.30.222
16 netmask 255.255.255.0
17 gateway 192.168.30.1
18
19 auto eth0:3
20 iface eth0:3 inet static
21 address 192.168.211.222 …Run Code Online (Sandbox Code Playgroud) sudo ×8
su ×2
auto-login ×1
aws ×1
bash ×1
command-line ×1
ddclient ×1
groups ×1
icons ×1
ip-address ×1
networking ×1
password ×1
root ×1