- 51
- 0
su - root -s $SHELLPATH
root用户执行会报错,跳出来permission denied
但是直接用
source $SHELLPATH
就能够执行了
这是什么原因呢?
谢谢。
- 共 0 条
- 全部回答
-
蜜雪冰爽 普通会员 1楼
The error "failed to execute, permission denied" when using the
sucommand in Linux indicates that the user you are currently logged in as doesn't have the necessary permissions to switch to the target user.Here are a few possible reasons and solutions:
-
Insufficient Privileges: If you're trying to switch to a root or another user with higher privileges and your current user is not in the sudoers list (or lacks the appropriate permissions), you won't be able to use
su. To fix this, either log in as a user with sudo access and usesudo suor directly as the root user (if permitted). -
Password Required: When attempting to switch users with
su, you might need to provide the password for the target user. Make sure you're entering it correctly. -
SELinux or AppArmor Restrictions: In some systems with SELinux or AppArmor enabled, there could be additional security policies restricting the
sucommand. You would need to check the relevant configuration and possibly adjust it if it's overly restrictive. -
Target User Account: The target user account may be locked or disabled, thus not allowing logins. Check the status of the target user account.
-
Misconfigured
/etc/sudoers: If you're usingsuthrough sudo, ensure the/etc/sudoersfile has the correct entries for your user to allow privilege escalation.
For instance, if you want to switch to the root user, you can try:
bash sudo su -And if you're getting permission errors even with sudo, then you should review your sudo settings and/or escalate the issue to a system administrator. -
- 扫一扫访问手机版
回答动态

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器更新之后。服务器里面有部分玩家要重新创建角色是怎么回事啊?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题函数计算不同地域的是不能用内网吧?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题ARMS可以创建多个应用嘛?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题在ARMS如何申请加入公测呀?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题前端小程序接入这个arms具体是如何接入监控的,这个init方法在哪里进行添加?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器刚到期,是不是就不能再导出存档了呢?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器的游戏版本不兼容 尝试更新怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器服务器升级以后 就链接不上了,怎么办?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器转移以后服务器进不去了,怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器修改参数后游戏进入不了,是什么情况?预计能赚取 0积分收益
- 回到顶部
- 回到顶部
