chsh:PAMauthentication失败

我想改变默认的shell env

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

但出现错误消息: chsh: PAM authentication failed

我find这个线程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会要求你input密码whaterver

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

愚蠢的错误,并感谢您的答复

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

看起来像你的道路我错了。 要检查它:

 [nick ~]$ which zsh /usr/bin/zsh 

如果结果是/ usr / bin / zch,这应该做的伎俩:

 [nick ~]$ chsh -s /usr/bin/zsh 

*编辑错字。

检查你的/etc/passwd 。 在我的情况下,我曾经指定一个无效的shell与chsh以前,这是什么原因造成的问题。

我把它从zsh作为shell改成了/bin/zsh ,这就让我的问题消失了。

我面临同样的问题。 每当我在chsh中input它用来提示

 chsh: PAM authentication failed 

但是我通过在/etc/passwd文件中做了一些修改来解决这个问题

 Users of kali-linux 

只要打开你的根terminal并修改/etc/passwd文件就可以使用pico,nano或者vi编辑器进行这个工作我正在用vi

 vi /etc/passwd 

然后search用户帐户。 并将shell更改为您所需的shell,确保在您的Linux发行版中安装了所需的shell,以便新用户查看他们的linux中是否存在shell,只需键入

 cat /etc/shells 

它会在那里列出它们。如果根本就安装了shell,并且在/etc/shell中看不到它,则需要创build一个链接并放置shell的path,以便手动假设/bin/ksh/etc/shells文件中…

例如你在bash中,你想把它改成ksh

只需要在/etc/passwd文件和最后一个字段编辑账户

/bin/bash/bin/ksh/bin/ksh93 (就像在你的cat /etc/shells

只是注销和login,你很好去…

对于其他发行版(比如说)Ubuntu的用户

input

sudo -H gnome-terminal (获取根terminal)

和上面一样,你也有像kali-linux用户一样的rootterminal。

你必须像sudo一样运行你的代码:

 sudo chsh -s /bin/zsh 

我也有同样的问题,它的工作!