标签: chsh

尝试更改默认 shell 时 /etc/passwd 中不存在用户

我想将我的默认 shell 从 tcsh 更改为 bash。所以我尝试了,这就是发生的事情:

>sudo chsh userid
Changing the login shell for userid
Enter the new value, or press ENTER for the default
        Login Shell [/xhbin/tcsh]: /bin/bash
chsh: user 'userid' does not exist in /etc/passwd
Run Code Online (Sandbox Code Playgroud)

确实,我不在 /etc/passwd 中。我不知道为什么。

我能做什么?

passwd chsh

44
推荐指数
5
解决办法
8万
查看次数

chsh 总是询问密码,并得到 `PAM: Authentication failure`

今天我尝试切换到另一个shell。

首先我尝试了fish,并用于chsh -s fish将fish更改为默认值。过了一段时间我发现它不能用~/.bashrc(&&需要用and代替)。

因为我更喜欢重用~/.bashrc,我发现zsh这似乎更容易,并按照此文档切换到zsh.

当我正在跑步时sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)",突然它要求我进入Password:。我输入了 root 密码,但得到了PAM: Authentication failure.

然后我试图chsh -s bashchsh -s zsh,它总是让我输入密码,抛PAM: Authentication failure(不系统密码)。我想不通。

command-line password chsh

36
推荐指数
3
解决办法
4万
查看次数

当用户不在 /etc/passwd 中时更改默认 shell

关于如何将外壳更改为鱼的任何想法?

$ sudo usermod -s /usr/bin/fish jaan
usermod: user 'jaan' does not exist in /etc/passwd
$ getent passwd $USER
jaan:x:15466:94:Jaan A:/home/jaan:/bin/zsh
Run Code Online (Sandbox Code Playgroud)

相关问题:尝试更改默认shell时,/etc/passwd中不存在用户 似乎它使用了ldap。

$ cat /etc/nsswitch.conf
passwd:         compat ldap
group:          compat ldap
shadow:         compat ldap

# Having the NOTFOUND=return bit was breaking dns resolution on web1 and web2. But we probably
# don't want any of the mdns stuff so let's get rid of it all.
#hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
hosts:          files dns

networks:       files

protocols:      db …
Run Code Online (Sandbox Code Playgroud)

command-line fish etc chsh

10
推荐指数
2
解决办法
1万
查看次数

如何将root的shell改回bash?

我尝试使用chsh命令更改 root 的 shell ,但是现在当我尝试以 root 身份使用sudo -i.

$ sudo -i
sudo: /usr/bin/bash: command not found
Run Code Online (Sandbox Code Playgroud)

我必须修改什么才能获得bash外壳?

command-line bash root chsh

6
推荐指数
1
解决办法
3346
查看次数

chsh:“您不能更改‘用户名’的 shell。”

我正在尝试更改我的用户的默认外壳程序。但我不断收到此错误:

$ chsh
You may not change the shell for 'flimm'.
$ chsh -s "$(which bash)"
You may not change the shell for 'flimm'.
Run Code Online (Sandbox Code Playgroud)

我试图理解为什么我不能为我的用户更改外壳。

chsh

6
推荐指数
3
解决办法
7963
查看次数

14.04 不对 chsh 命令进行身份验证

我正在尝试将我的默认 shell 更改为 zsh。我将条目正确放置在 /etc/shells 文件中。

我使用此命令所做的每次尝试都以相同的错误消息结束:

chsh -s $(which zsh)
Password: ### after entering the correct password
chsh: PAM: Authentication failure

sudo chsh -s $(which zsh) ## yields the same result
Run Code Online (Sandbox Code Playgroud)

我已将 sudo 用于其他命令,以确保它不是密码失败,并且所有其他命令都有效,但对“chsh”不起作用。

完全被难住了。

附加信息:

我已经按照 Oli 的建议代码在 /etc/shells 文件中附加了一行。

echo $SHELL 
/bin/bash

sudo chsh -s /usr/local/bin/zsh
Password:
chsh: PAM: Authentication failure

chsh -s /usr/local/bin/zsh
You may not change the shell for 'username'
Run Code Online (Sandbox Code Playgroud)

还是不能换壳。

command-line pam chsh 14.04

5
推荐指数
1
解决办法
1万
查看次数

当您在没有用户名的情况下 chsh 时会发生什么?

人们可以: sudo chsh -s /bin/sh 或者 sudo chsh -s /bin/sh user_name

据了解,第二个命令更改了指定用户名的 shell,但不清楚在不指定用户名的情况下会发生什么以及反映在哪里?

谢谢你!

chsh

3
推荐指数
1
解决办法
506
查看次数

标签 统计

chsh ×7

command-line ×4

14.04 ×1

bash ×1

etc ×1

fish ×1

pam ×1

passwd ×1

password ×1

root ×1