在OpenSUSE Linux中安装sudo软件包

zypper in sudo

使用它来搜索sudo包

zypper search sudo
在OpenSUSE如何安装sudo来像root一样执行命令

在OpenSUSE Linux服务器上没有安装sudo。只能使用' su - '命令切换到root再进行操作。

如何在OpenSUSE Linux上安装sudo?

Zypper是一个用于SUSE和OpenSUSE Linux的命令行包管理器。

测试

sudo systemctl restart httpd.service

sudo的配置文件

创建一个sudo的配置文件是 /etc/sudoers.d/wheel-users

/etc/sudoers.d/wheel-users:

%wheel ALL=(ALL) ALL

修改sudo配置文件:

includedir /etc/sudoers.d
#Defaults targetpw # ask for the password of the target user i.e. root
#ALL ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!

将用户添加到wheel组。

在SUSE中,所有可以sudo的用户都属于wheel组

添加wheel组并将sudo用户添加到这个组中

groupadd wheel
usermod -aG wheel tir
id tir

选择tir用户就可以执行sudo操作了。

日期:2019-04-29 03:18:27 来源:oir作者:oir