Change user shell on FreeBSD Linux and AIX
參考資料: 這裡
Display user information (FreeBSD):
$pw usershow user_name user_name:*:1002:1002::0:0:Some User Name:/home/user_name:/bin/sh
You’ll notice that last field (/usr/local/bin/bash) is the shell of the user.
Display user information(AIX):
$ lsuser -a shell root root shell=/usr/bin/ksh
Change user’s shell on FreeBSD system to bash
$ pw usermod user_name -s /usr/local/bin/bash $ pw usershow user_name user_name:*:1002:1002::0:0:Some User Name:/home/user_name:/usr/local/bin/bash
Change user’s shell on Linux
$ chsh -s /bin/bash user_name
Change user shell on AIX
$ chuser shell=/path/to/new/shell root
In this article I’ve used root and user_name users.
You’ll have to use whatever suits your case.
Be careful to what shell you’re changing to because that user (or root in some cases) will not be able to log in if the shell does not exist or is an altered binary file.