How to check/change a user's default login shell

$ getent passwd $LOGNAME | cut -d: -f7
OR
$ ps -p $$

$ returns the PID (process identification number) of the current process, and the current process is your shell. So running a ps on that number displays a process status listing of your shell. In that listing you will find the name of your shell (look for CMD column) .

Example:
$ getent passwd postfix | cut -d: -f7
/sbin/nologin Or /bin/false
$ which bash
/bin/bash
$ sudo chsh -s /bin/bash postfix
Changing shell for postfix.
Shell changed.
$ getent passwd postfix | cut -d: -f7
/bin/bash
sudo chsh -s /sbin/nologin postfix
Changing shell for postfix.
Shell changed.
$ getent passwd postfix | cut -d: -f7
/sbin/nologin
$

Featured Post

Updated Coupons / promo codes for Google Apps for Work / Business

To redeem: 1. Sign up for Google Apps   2. Go to your billing settings  3. Choose your payment plan  4. Enter your promo code ...