Linux chsh命令用于更改使用者 shell 設(shè)定。
使用權(quán)限:所有使用者。
shell>> chsh
shell>> chsh Changing fihanging shell for user1 Password: [del] New shell [/bin/tcsh]: ### [是目前使用的 shell] [del] shell>> chsh -l ### 展示 /etc/shells 檔案內(nèi)容 /bin/bash /bin/sh /bin/ash /bin/bsh /bin/tcsh /bin/csh
改變當(dāng)前的shell。當(dāng)前的shell 設(shè)置為//bin/bash,通過(guò)chsh命令,改變shell的設(shè)置/bin/csh。
# chsh Changing shell for root. New shell [/bin/bash]: /bin/csh //輸入新的shell地址 Shell changed.
通過(guò) -s 參數(shù)改變當(dāng)前的shell設(shè)置
# chsh -s /bin/csh //改變當(dāng)前設(shè)置為 /bin/csh Changing shell for root. Shell not changed.