Use Bash on a Non Bash User

From Brian Nelson Ramblings
Jump to: navigation, search

Using Bash on an Account without Bash

Have you ever tried to use bash on an account that does not have bash setup on it, example apache.

When trying to SuperUser into apache, you will get the error "This account is Currently no Available"

Now you can always just change that user and give them /bin/bash

chsh -s /bin/bash apache

But that is not really what you want to do, unless that account needs bash access.

To use that account with bash without changing the account you can also su into the user.

su {useraccount} -s /bin/bash

You will become that user even though they do not have bash access.

How to check the shell on Users

You will want to check out the /etc/passwd file.

You would be looking for users with /bin/false or /bin/nologin or /usr/sbin/nologin


List of available shells on your machine

To see a list of the available shells on your machine, you can take a look at the /etc/shells file

$ cat /etc/shells
# /etc/shells: valid login shells