如何在FreeBSD中为用户赋予Su Rigth?

I have a FreeBSD box. I want to connect this system remotely with ssh. FreeBSD security settings are very restricted so we can not connect the FreeBSD system with root user remotely. We will ssh with a regular existing user and then login as root with su command. The problem is the regular existing user can not run su command. How can we give the ability to run su command to a regular user in FreeBSD?

我有一个FreeBSD盒子。 我想将此系统与ssh远程连接。 FreeBSD的安全性设置非常严格,因此我们无法将FreeBSD系统与root用户远程连接。 我们将使用常规的现有用户ssh,然后使用su命令以root用户身份登录。 问题是普通现有用户无法运行su命令。 我们如何赋予FreeBSD中的普通用户运行su命令的能力?

su错误 (su Error)

When we try to run su command we will get following errors.

当我们尝试运行su命令时,将出现以下错误。

$ su 
su: Sorry 
$ su root 
su: Sorry 
$ sudo root 
-sh: sudo: not found 
$ sudo su 
-sh: sudo: not found

将用户添加到转轮组 (Add User To Wheel Group)

We need to add the current user to the wheel group. Open /etc/group file with an editor you are comfortable. Here I used vi because I have no chose. And add user name after the root user name like below.

我们需要将当前用户添加到wheel组。 使用舒适的编辑器打开/ etc / group文件。 在这里我使用vi是因为我没有选择。 并在根用户名之后添加用户名,如下所示。

wheel:*:0:root,ismail

升级特权 (Escalate Privilege)

Now we can easily su with our user ismail

现在,我们可以轻松地与我们的用户ismail su

$ su 
Password: 
[email protected]:/usr/home/ismail # cat /etc/group  
# $FreeBSD: releng/11.0/etc/group 294896 2016-01-27 06:28:56Z araujo $ 
#
Escalate Privilege
Escalate Privilege
升级特权
LEARN MORE  How To Install Tenable Nessus into Kali?
了解更多如何将持久的Nessus安装到Kali中?

翻译自: https://www.poftut.com/give-su-rigth-user-freebsd/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值