加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – chsh:PAM身份验证失败

发布时间:2020-12-13 18:08:20 所属栏目:Linux 来源:网络整理
导读:我想更改默认的 shell env 并以root用户身份运行chsh -s / bin / zsh, 但出现错误消息:chsh:PAM身份验证失败. 我发现这个帖子http://ubuntuforums.org/showthread.php?t=1702833 但答案并没有解决我的问题 任何帮助,将不胜感激 这是/etc/pam.d/chsh的内容
我想更改默认的 shell env

并以root用户身份运行chsh -s / bin / zsh,

但出现错误消息:chsh:PAM身份验证失败.

我发现这个帖子http://ubuntuforums.org/showthread.php?t=1702833

但答案并没有解决我的问题

任何帮助,将不胜感激

这是/etc/pam.d/chsh的内容

#
# The PAM configuration file for the Shadow `chsh' service
#

# This will not allow a user to change their shell unless
# their current one is listed in /etc/shells. This keeps
# accounts with special shells from changing them.
auth       required   pam_shells.so

# This allows root to change user shell without being
# prompted for a password
auth            sufficient      pam_rootok.so

# The standard Unix authentication modules,used with
# NIS (man nsswitch) as well as normal /etc/passwd and
# /etc/shadow entries.
@include common-auth
@include common-account
@include common-session

这是/ etc / shells的内容

# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/usr/bin/tmux
/usr/bin/screen
/bin/zsh
/usr/bin/zsh

我发现我曾经运行chsh -s zsh
这将改变/ etc / passwd的第一行为

root:x:0:0:root:/root:zsh

并且chsh会在你尝试时询问密码

我只是手动编辑/ etc / passwd文件,一切正常.

愚蠢的错误,谢谢你的回复

解决方法

如果此行不存在,请检查/ etc / shells文件并将/ bin / zsh添加到文件中.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读