カテゴリ:

If you would like to make an user who could not log into the system like just mail account user, use nologin instead of bash. nologin is a special command that politely refuse a login.

# grep nologin /etc/shells
/sbin/nologin

Use -s option to define the shell.

# useradd -s /sbin/nologin tomato
# su - tomato
This account is currently not available.

If you would like to change the shell of existing user, use usermod command.

# usermod -s /sbin/nologin lettuce
# su - lettuce
This account is currently not available.