+2 votes
in Operating Systems by (73.8k points)

I added a new user account to my VPS from CentOS Web Panel (CWP) GUI. While creating the user account, I had selected the option to enable SSH for the user. However, when I try to SSH using the new user, I get the following error message:

This account is currently not available

How can I fix it? 

1 Answer

+1 vote
by (348k points)
selected by
 
Best answer

It seems that the shell for your new user has been set to '/sbin/nologin'. Therefore you are getting the error message 'This account is currently not available'.

Here are the steps you need to follow to fix this error so that you can SSH using non-root user.

1. Log into your VPS using 'root' and check the shell for the new user your created. The line for the new user in file '/etc/passwd' should look like:

username:x:1001:1001::/home/username:/sbin/nologin

2. Check the shells available on your VPS by typing the following command:

#cat /etc/shells

3. If '/bin/bash' is present in the above file, run the following command to change the shell for the new user.

#chsh -s /bin/bash username

If successful, you should get the following message:

Changing shell for username.
Shell changed.

If you do not like to run chsh command, you can edit '/etc/passwd' manually.

#vi /etc/passwd

and change

username:x:1001:1001::/home/username:/sbin/nologin

to

username:x:1001:1001::/home/username:/bin/bash

These steps should solve your problem and you do not have to reboot your VPS too.


...