错误密码:chsh:PAM:尝试安装时身份验证失败哦我的zsh


11

我尝试安装我的zsh。安装zsh(sudo apt-get update && sudo apt-get install -y zsh)之后

然后我安装

sudo apt-get install -y curl  

然后安装git。

当我尝试此命令时会出现问题。

curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | bash

这是日志

sudo curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   146  100   146    0     0     91      0  0:00:01  0:00:01 --:--:--    91
100  1779  100  1779    0     0    525      0  0:00:03  0:00:03 --:--:--  1416
\033[0;34mCloning Oh My Zsh...\033[0m
Cloning into '/home/icom3/.oh-my-zsh'...
remote: Reusing existing pack: 10101, done.
remote: Total 10101 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (10101/10101), 1.92 MiB | 172.00 KiB/s, done.
Resolving deltas: 100% (5337/5337), done.
Checking connectivity... done.
\033[0;34mLooking for an existing zsh config...\033[0m
\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m
\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m
\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m
\033[0;34mTime to change your default shell to zsh!\033[0m
Password: chsh: PAM: Authentication failure

有什么主意吗

请注意,我已经尝试过

sudo vim /etc/pam.d/chsh  

然后注释auth required pam_shells.so。但是,该错误仍然会发生。

Answers:


16

分别下载并运行脚本:

curl -OL https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh
bash install.sh

您可能应该撤消对的更改/etc/pam.d/chsh

说明:

用管道将脚本文本 bash

cat script.sh | bash

与提供脚本作为参数不同 bash

bash script.sh

通过管道install.sh传输到bash,bash 从管道而不是用户那里获取其标准输入(stdin)。在这种情况下,chsh似乎还从stdin接收了输入,stdin是对调用之后脚本中的下一行chsh。(此刻似乎是一个空行。如果您输入的是密码,则不会有任何问题;-))

您可以使用以下简短脚本进行测试,该脚本中应包含read一行输入:

read -p 'input: ' INPUT
echo -n 'You wrote this: '
echo "> $INPUT <"

另存为script.sh

$ bash script.sh
input: foobar
You wrote this: > foobar <
$ cat script.sh | bash
> echo -n 'You wrote this: ' <

2
很好的诊断。我在Debian上遇到了同样的问题,您的修复对我有效。oh-my-zsh项目上有几个未解决的问题(github.com/robbyrussell/oh-my-zsh/issues/3516),因此希望它也能在上游得到解决。顺便说一句,次要的nitpick:curl将文件打印到stdout,而不是像wget; 那样写文件;您需要curl -L ... > install.sh在命令末尾进行重定向。
Andrew Janke

@AndrewJanke感谢(不是)次要的nitpick。现在已修复。
阿达芬2015年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.