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
Gilles/usr/sbin/nologin
on the command-line, the computer responds with This account is currently not available.
. 561k134134 gold badges11571157 silver badges16631663 bronze badges
peterpeter28711 gold badge55 silver badges1414 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
.You should use March air force base jag office hours.
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
:This allows anyone in group
somegroup
to run the command as secure
without entering a password:This allows
user1
to run the command as secure
without entering a password:cg909cg909
I found out the main problem is '
peterpeter/usr/sbin/nologin
' in /etc/passwd
When 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
28711 gold badge55 silver badges1414 bronze badges
su
is using the shell specified in /etc/passwd
.You don't need to use
su
with sudo
.Therefore don't mix
ctrl-alt-delorctrl-alt-delorsu
with sudo
: use sudo -u secure '/home/someuser/secure.script'
.13.6k55 gold badges2929 silver badges6464 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.
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.
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.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 want to perform some actions on behalf of some non-login users, such as e.g.
www-data
or uwsgi
. My purpose is to test some permissions, check what dirs they can modify etc etc.Is there a recommended way of going about this, other than creating a shell and password for them and
su
?edit:
When I try to
su
to the specific user with sudo
:pkaramol
pkaramolpkaramolNologin This Account Is Currently Not Available
2,58811 gold badge2525 silver badges6464 bronze badges
1 Answer
You don't need to create a shell and password for them, you can simply run
su
as root and use the --shell
argument of su
.To run a bash shell as
www-data
run:as root.
hek2mglhek2mgl112k1414 gold badges155155 silver badges177177 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged linuxshellpermissionsfile-permissions or ask your own question.
Hi!
The following is a trick from another user:
I cleared my game cache, closed the store, rebooted my computer, tried reinstalling the game and it worked.
https://answers.microsoft.com/en-us/windows/for..
These are for another game but you can try:
I fixed . I had second profile on my laptop, so I downloaded Magic Jigsaw puzzle on that profile and then signed into FB. I used the same FB that I used with one I am having the issues with. Then went back to the first profile and tried to open the game the error was gone.
ok not sure why it worked but i logged into the store (on the same computer im having issues with) under an account i made for my son and was able to reinstall the jigsaw puzzle game. once it loaded it logged me into my actual account and everything is working fine now. Not sure why it was not working but i can play again and all my info is there so maybe try making a different account and then reinstall under it then load the game with your main account again.
https://answers.microsoft.com/en-us/windows/for..
The following is a trick from another user:
I cleared my game cache, closed the store, rebooted my computer, tried reinstalling the game and it worked.
https://answers.microsoft.com/en-us/windows/for..
These are for another game but you can try:
I fixed . I had second profile on my laptop, so I downloaded Magic Jigsaw puzzle on that profile and then signed into FB. I used the same FB that I used with one I am having the issues with. Then went back to the first profile and tried to open the game the error was gone.
ok not sure why it worked but i logged into the store (on the same computer im having issues with) under an account i made for my son and was able to reinstall the jigsaw puzzle game. once it loaded it logged me into my actual account and everything is working fine now. Not sure why it was not working but i can play again and all my info is there so maybe try making a different account and then reinstall under it then load the game with your main account again.
https://answers.microsoft.com/en-us/windows/for..
An error occurs when I try to make SSH connection:
Mert ÖzoğulMert Özoğul32011 gold badge44 silver badges1212 bronze badges
3 Answers
You're getting the
This account is currently not available.
error because the shell for the user www-data
is set to /usr/sbin/nologin
, and it's set for a very good reason. You should not log in as www-data
, it's a special user/group used by the web server, not intended for regular shell use.EDIT: It is an especially bad idea to give
kraxorkraxorsudo
rights to www-data
. If Apache was intended to run with root permissions, it wouldn't have it's own group. By doing this, you are creating huge security holes. You have been warned.4,37933 gold badges1919 silver badges3232 bronze badges
While I agree with the others that allowing login through SSH through the www-data user is generally a bad idea, once you've logged in with a normal user it may be useful to run multiple commands concurrently with the permissions set of the www-data user. In that case, one can run
and you will be able to access your files as the www-data user.
D. Scott BoggsD. Scott Boggs
The first question I would have to ask is, what are you trying to accomplish by doing this?
kraxor is 100% correct you should never be able to ssh into your server using your Apache/Nginx user. Doing so invites every hacker with half a brain cell into your server.
![This account is currently not available. summary This account is currently not available. summary](https://www.zioncyclery.com/images/library/Zoom/haro_flightline-29-sport-sg-charcoal-sg-black_12_z.jpg)
If you need to run a script or some program as that user you could try
sudo -u www-data yourscript
or you could temporally chown
on the file to a user with login privileges. It's just a vary bad idea to allow this account that kind of access.TheStarvingGeekTheStarvingGeek