This Account Is Currently Not Available. Su Rating: 8,9/10 7058 reviews
  1. Google Is Currently Not Available
  2. This Account Is Currently Restricted
  3. This Account Is Currently Not Available. Survey

In this case I'm trying to start Jenkins as a service on FreeBSD 8.3. I recently upgraded my Jenkins installation from 1.476 to 1.554 using pkgng. I haven't used the previous installation, so (as far as I know) the service was never started before.

If I su to nobody, I get 'This account is currently not available' message. But I can su to techlist, since it has a valid shell (ie. Edit that file for the correct user.

This is what I do (and get):

I already located the jenkins user on my system. So it's present. And I checked if if the jenkins_user is overridden in the /etc/rc.conf or the /etc/defaults/rc.conf file, and it's not. The user 'jenkins' should be the user it starts as according to the following lines in /usr/local/etc/rc.d/jenkins:

I would like to know what the problem is. Hope someone can help me. Thanks for your time!

Tommy Bravo
Tommy BravoTommy Bravo

1 Answer

It turns out that the old jenkins user had /usr/sbin/nologin as shell. Which needs to be something like /bin/sh or /usr/local/bin/bash. I did a manual removal of the user and the jenkins package and then after a re-install it finally 'worked'. And I noticed the significant change in the user shell.

Google Is Currently Not Available

I get other errors now, but at least I can see them in my logs (/var/log/jenkins.log). And the dreaded 'This account is currently not available.' message is gone.

Tommy BravoTommy Bravo

Not the answer you're looking for? Browse other questions tagged javafreebsdjenkins or ask your own question.

I created special user in /etc/passwd with:

I don't want to allow login of this user (via console, ssh, ftp, any way).

He is just for running one script via:

But it gives me This user is currently not available.. How to set it up to be able to run script this way but prevent any login (console, ssh, ftp,...) of this user to system?

I have noticed thatwhen I type /usr/sbin/nologin on the command-line, the computer responds with This account is currently not available..

Gilles
561k134 gold badges1157 silver badges1663 bronze badges
peterpeter
2871 gold badge5 silver badges14 bronze badges

4 Answers

This is a typical use case for sudo.

You're mixing sudo which allows running commands as another user and is highly configurable (you can selectively specify which user can run which command as which user) and su which switches to another user if you know the password (or are root). su always runs the shell written in /etc/passwd, even if su -c is used. Because of this su isn't compatible with /usr/sbin/nologin.

This Account Is Currently Restricted

You should use

sudo -u secure /home/someuser/secure.script

As sudo is configurable you can control who can use this command and if he/she needs to enter a password to run it. You need to edit /etc/sudoers using visudo to do this. (Be careful when editing /etc/sudoers and always use visudo to do it. The syntax isn't trivial and one error can lock you out from your root account.)

This line in sudoers allows anyone in group somegroup to run the command as secure:

Currently

This allows anyone in group somegroup to run the command as secure without entering a password:

This Account Is Currently Not Available. Survey

This allows user1 to run the command as secure without entering a password:

cg909cg909

I found out the main problem is '/usr/sbin/nologin' in /etc/passwdWhen I want to execute su in this case, it must have -s /bin/bash inside, so for example: su -s /bin/bash -c '/home/someuser/secure.script' secure

peterpeter
2871 gold badge5 silver badges14 bronze badges

su is using the shell specified in /etc/passwd.

You don't need to use su with sudo.

Therefore don't mix su with sudo: use sudo -u secure '/home/someuser/secure.script'.

ctrl-alt-delorctrl-alt-delor
13.6k5 gold badges29 silver badges64 bronze badges

This might not be 100% relevant to the question but may help someone who had similar warning message This user is currently not available

1) Check with your hosting company if you have been grant shell access.

2) if you are using CWP7: Set Shell Access To ON

ShapCyberShapCyber

Not the answer you're looking for? Browse other questions tagged sudouserssu or ask your own question.