admin管理员组

文章数量:1618689

记录报错_linux: su root 报错: su: Authentication failure

    • su: Authentication failure
    • 关于 su 用法 :
    • 常用
      • 下图为使用其他用户进行命令 ls 操作
      • 下图为变更用户操作:

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

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,
–preserve-environment 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

下图为变更用户操作:

本文标签: 报错LinuxSUfailureauthentication