Have you ever got an error “This account is currently not available” when trying to login via SSH or trying to “su” to certain user? Read here what this error means and how you can easily fix it!
Example of the error:
[mitch@foohost ~]$ ssh geekpeek@foo1 geekpeek@foo1 password: Last login: Fri Jun 21 08:03:57 2013 from firstname.lastname@example.org This account is currently not available. Connection to foo1 closed.
What does “This account is currently not available” error mean?
“This account is currently not available” error means what is says.The account you are trying to “su” to or trying to login with is currently not available because there is no valid shell set for this user.
You can check this by looking into /etc/passwd file and see the shell which is set for the desired user. If the shell is set to “/bin/false” or “/sbin/nologin” you have confirmed the problem.
Here is an example of users geekpeek and geekpeeknet with “/bin/false” and “/sbin/nologin” shell.
How to fix “This account is currently not available” error?
You can fix this error by setting a shell for the desired user. You can do this via “chsh” command or by editing /etc/passwd file.
When using “chsh” command you should do something like this (you should run this as root or via sudo!):
[root@foo1 ~]# chsh -s /bin/bash geekpeek [root@foo1 ~]# chsh -s /bin/bash geekpeeknet
After this /etc/passwd user line should look something like this:
If not, try to edit /etc/passwd file manually and setting the desired shell. Now you should be able to login to your user account via SSH or “su”.
If you do not know which shells are available on your system you can run a command “chsh” or “cat /etc/shells” as seen below!
[root@foo1 /]# chsh --list-shells /bin/sh /bin/bash /sbin/nologin /bin/dash [root@foo1 /]# cat /etc/shells /bin/sh /bin/bash /sbin/nologin /bin/dash