So, you try to log into your Linux server via ssh and you receive the following error:
This account is currently not available.
The are two main causes for this:
1. The shell does not exist anymore or has been removed
2. There’s an issue with the user’s shell path
I recommend looking at the user’s shell path first by opening the /etc/passwd file. Substitute ‘username’ with the actual user’s username.
cat /etc/passwd | grep username
In this example, I get this issue when trying to login as the mysql user so I’m looking specifically at the mysql user.
cat /etc/passwd | grep mysql
Output should like similar to this:
The tail end of the output “:/sbin/nologon” indicates the shell. In this case, it’s apparent that this user was not setup with a /home directory and was setup to NOT be able to actually log into the server.
If you would like this user to be able to log into the server, all we must do is change the shell path. They still won’t have a /home directory (unless we change that too) but the user will be able to login.
To view the available shells on the system, run the following command:
If you would like to change a user’s shell, run this command:
chsh -s /bin/bash username