在FreeBSD下以其他用户身份运行 [英] Run as different user under FreeBSD

查看:142
本文介绍了在FreeBSD下以其他用户身份运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在FreeBSD中,有没有一种方法可以(以root身份)以没有特权的用户身份(没有人)运行命令?有点像sudo的反转.哦,考虑到没人"将/usr/sbin/nologin作为外壳程序-因此 su 是不可选择的.

Is there a way in FreeBSD to (being root) run a command as unprivileged user, like nobody? Kind of like reverse of sudo. Oh and considering that 'nobody' has /usr/sbin/nologin as shell - so su is not an option.

推荐答案

sudo将允许您以其他用户身份运行命令.

sudo will allow you to run a command as another user.

sudo -u nobody <command>

将以无人运行,即使他们的登录外壳不可用.

will run as nobody, even if their login shell is not available.

这篇关于在FreeBSD下以其他用户身份运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆