希望能写一些简单教程案例分享需要的人

su: Authentication failure

su root 切换用户提升权限的时候报错:su: Authentication failure

在这里插入图片描述

输入下面命令,再输入两次密码就行了。

sudo passwd root

参考下图,进行 su root 则不会报错了
在这里插入图片描述

关于 su 用法

Options:
c, —command COMMAND pass COMMAND to the invoked shell
h, —help display this help message and exit
-, -l, —login make the shell a login shell
m, –p,
preserveenvironment do not reset environment variables, and
keep the same shell
-s, —shell SHELL use SHELL instead of the default in passwd

su – :登录其他用户
su – c : 用其他用户身份执行命令

常用

下图使用其他用户进行命令 ls 操作

如果我们执行其他命令替换掉 ls 即可

su root -c ls

在这里插入图片描述

 su - root

下图变更用户操作

在这里插入图片描述

原文地址:https://blog.csdn.net/qq_36051316/article/details/128032026

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_47044.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注