UmA*_*orn 11 command-line bash authentication zsh
我尝试安装哦我的 zsh。安装 zsh ( sudo apt-get update && sudo apt-get install -y zsh
) 后
然后我安装
sudo apt-get install -y curl
Run Code Online (Sandbox Code Playgroud)
然后安装git。
当我尝试此命令时会出现问题。
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | bash
Run Code Online (Sandbox Code Playgroud)
这是日志
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
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?
请注意,我已经尝试过
sudo vim /etc/pam.d/chsh
Run Code Online (Sandbox Code Playgroud)
然后评论 auth required pam_shells.so。但是,错误仍然发生。
Ada*_*hon 16
单独下载并运行脚本:
curl -OL https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh
bash install.sh
Run Code Online (Sandbox Code Playgroud)
您可能应该撤消对/etc/pam.d/chsh
.
解释:
将脚本的文本通过管道传输到 bash
cat script.sh | bash
Run Code Online (Sandbox Code Playgroud)
与将脚本作为参数提供给 bash
bash script.sh
Run Code Online (Sandbox Code Playgroud)
通过管道install.sh
到bash
,bash从管道而不是用户获取其标准输入(stdin)。在这种情况下,chsh
似乎也从stdin接收其输入,这是脚本中调用chsh
. (目前它似乎是一个空行。如果它是你的密码,你就不会有任何问题;-))
您可以使用这个简短的脚本进行测试,其中read
需要一行输入:
read -p 'input: ' INPUT
echo -n 'You wrote this: '
echo "> $INPUT <"
Run Code Online (Sandbox Code Playgroud)
保存为script.sh
:
$ bash script.sh
input: foobar
You wrote this: > foobar <
$ cat script.sh | bash
> echo -n 'You wrote this: ' <
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
13050 次 |
最近记录: |