usermod -s /bin/sh maria; # change login-shell of maria to sh # tested and works on debian8, suse12, centos7 usermod -s /bin/zsh maria; # change login-shell of maria to zsh (needs to be installed first apt-get install zsh) # you can switch over su - maria; # change from root to non-root user maria echo $SHELL; # view the currently used shell of logged-in user /bin/sh
who is using what?
grep /bin/bash /etc/passwd; # output all interactive user accounts that use bash as shell
grep /bin/sh /etc/passwd; # output all interactive user accounts that use sh as shell grep /bin/false /etc/passwd; # output all service accounts that can not used to login usermod -s /bin/false maria; # change login-shell of maria to /bin/false (no login shell)
/bin/false is usually used for users who’s sole purpose it is to run a service with non-root privileges
– so it’s not possible to hack-in with them via ssh for security reasons.
Zsh is a UNIX command interpreter (shell) usable as an interactive login shell and as a shell script command processor. Of the standard shells, zsh most
closely resembles ksh but includes many enhancements. Zsh has command line editing, builtin spelling correction, programmable command completion, shell
functions (with autoloading), a history mechanism, and a host of other features.
bash – GNU Bourne-Again SHell
Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc.
Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. Bash also incorporates useful
features from the Korn and C shells (ksh and csh).
Bash is intended to be a conformant implementation of the Shell and Utilities portion of the IEEE POSIX specification (IEEE Standard 1003.1). Bash can
be configured to be POSIX-conformant by default.
sh – shell, the standard command language interpreter
This manual page is part of the POSIX Programmer’s Manual.
The Linux implementation of this interface may differ (consult the corresponding Linux manual
page for details of Linux behavior), or the interface may not be implemented on Linux.
The sh utility is a command language interpreter that shall execute commands read from a command line string, the standard input, or a specified file.
The application shall ensure that the commands to be executed are expressed in the language described in Shell Command Language.
Pathname expansion shall not fail due to the size of a file.
Shell input and output redirections have an implementation-defined offset maximum that is established in the open file description.