ohmyzsh: chsh: PAM authentication failed on Ubuntu 12.04
I’m using Ubuntu through travis-ci to test my dotfiles. I got the same error on my 12.04 when I installed oh my zsh after have followed the same steps.
After installing zsh (sudo apt-get install zsh) and change my shell successfully (sudo chsh --shell $(which zsh)), I still get an error from oh my zsh install.sh :
Password: chsh: PAM authentication failed
385 __ __
386 ____ / /_ ____ ___ __ __ ____ _____/ /_
387 / __ \/ __ \ / __ `__ \/ / / / /_ / / **_/ __ \
388/ /_/ / / / / / / / / / / /_/ / / /_(** ) / / /
389_**_/_/ /_/ /_/ /_/ /_/\**, / /**_/_**_/_/ /_/
390 /____/
391
392
393 ....is now installed.
394sh: source: not found
395make: **\* [zsh] Error 127
The complete error stack is available at : http://travis-ci.org/#!/sieben/dotfiles
About this issue
- Original URL
- State: closed
- Created 12 years ago
- Comments: 35 (5 by maintainers)
Commits related to this issue
- Use sudo chsh to avoid PAM authentication error https://github.com/robbyrussell/oh-my-zsh/issues/1224 — committed to RobertTheNerd/oh-my-zsh by RobertTheNerd 8 years ago
well, my solution maybe help you
then, comment
auth required pam_shells.sodone, logout and login does it work?
To solve this actually you have to chsh as your user. When you sudo it’ll change the shell of the root account.
Instead:
chsh $USER -s $(which zsh);Then logout and log back in. or source your zshrc file:
source ~/.zshrcI have a EC2 whit fish shell. Is the same problem.
Then I logout and login.
If the hostname is not the default or get the message “sudo: unable to resolver host”, fix the hosts file in your server.
Hi folks. I think most of these are misdiagnoses. The main problem is that on Linux,
chshprompts for password when you’re not root, and when installing with the formcurl ... | sh, the shell’s stdin is hooked up to the pipe containinginstall.sh, so whenchshprompts for a password, it’s reading from the install script instead of the terminal and your keyboard. (This AskUbuntu answer nails it.) So thatchshcommand will work when you type it interactively, but not from within the installer script when invoked the way we do now.A workaround is to use a temp file instead of a pipe for the install script. This will leave stdin attached to the tty for
chshto read from, and will work without changes to the script itself.1+ for @sanbor’s
@benjamine We can also use whoami to automatically add username to the end of a script:
@ryaninhust works for me…haha