1.查看当前系统中所有的shell
cat /etc/shells
输出结果如下
localhost:~ Leon$ cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
2.查看系统用户默认shell
cat /etc/passwd | grep sh
输出结果如下
localhost:~ Leon$ cat /etc/passwd | grep sh
root:*:0:0:System Administrator:/var/root:/bin/sh
_sshd:*:75:75:sshd Privilege separation:/var/empty:/usr/bin/false
_update_sharing:*:95:-2:Update Sharing:/var/empty:/usr/bin/false
_mbsetupuser:*:248:248:Setup User:/var/setup:/bin/bash
3.输出当前使用的shell
echo $0
输出结果如下
localhost:~ Leon$ echo $0
-bash
4.修改系统默认shell为zsh
chsh -s /bin/zsh
之后输入密码就齐活。