问题
我想将默认的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
答案1
必须执行chsh。
答案2
gnome-terminal
有一个解决方法:
bash
作为自定义命令(或fish
或内容)答案3
只需键入:
chsh
没有sudo
和不带参数。
另请参见man chsh
:
The chsh command changes the user login shell. This determines the name of the user's initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account.
答案4
如果忘记了用户名,可以使用whoami
命令记住你。
尝试使用:
sudo chsh $(whoami)
如果在/etc/passwd文件中不存在以您的用户名开头的行(这似乎莫名其妙),则可以添加一个新的,如下所示:
username:x:1000:1000:your real name,,,:/home/username:/bin/bash
相关文章