You are not logged in.

#1 2007-04-28 18:59:03

hybrid
Member
Registered: 2007-02-05
Posts: 261

start daemon as 'nobody'

I want to start nxtvepg as a daemon under user nobody. su nobody -c "nxtvepg -daemon with all my options and shit" asks me for a password. How can I do what I want (preferably without sudo)?
thx for your help

Offline

#2 2007-04-28 20:18:53

dschrute
Member
From: NJ, USA
Registered: 2007-04-09
Posts: 183

Re: start daemon as 'nobody'

Are you logged in as root when running it ? 

If not, you will be prompted for the user's password.  IIRC, only root should not be prompted when doing a "su anyuser -c some-command..."

Last edited by dschrute (2007-04-28 20:19:20)

Offline

#3 2007-04-29 01:20:54

hybrid
Member
Registered: 2007-02-05
Posts: 261

Re: start daemon as 'nobody'

Yeah, I'm root. Kindof sucks cuz I wanted to put that into my rc.local but when I do my bootprocess gets interrupted and I'm prompted to change the password..

edit: here.. wtf:

# su nobody -c "touch /tmp/test1.txt"
You are required to change your password immediately (root enforced)
Changing password for nobody
(current) UNIX password: 
su: incorrect password

Last edited by hybrid (2007-04-29 01:26:09)

Offline

#4 2007-04-29 05:09:43

hacosta
Member
From: Mexico
Registered: 2006-10-22
Posts: 423

Re: start daemon as 'nobody'

i don't know for sure and i can't test it now but
passwd nobody should do it..

Offline

#5 2007-04-29 14:12:19

hybrid
Member
Registered: 2007-02-05
Posts: 261

Re: start daemon as 'nobody'

Well but I don't want to change a password for nobody, I mean, I dunno where nobody might be used elsewhere by Arch and if I change the password I don't know what I might screw up by doing so..

Offline

#6 2007-04-29 14:34:16

dschrute
Member
From: NJ, USA
Registered: 2007-04-09
Posts: 183

Re: start daemon as 'nobody'

Check your /etc/pam.d/su file...

You should have a line like the following that is uncommented :
auth            sufficient      pam_rootok.so

If it's commented out, or isn't there, root will be prompted for the user's password when su'ing. 

But in testing this, I am prompted to change "nobody's" password.  So it may be necessary to set it in order to run commands via su.  You could also create a user identical to nobody, for just this specific purpose, if you can't find a work-around to setting the password.
You may also want to check the password ( 2nd) field in /etc/shadow for differences in user accounts.  As root I am able to run su without being prompted for a password, for any user with "!" in the password field, but not with "*".  You should confirm, but I think you would be safe by simply changing this from one to the other, and the account would still be restricted from direct logins.

Offline

#7 2007-04-30 22:05:44

hybrid
Member
Registered: 2007-02-05
Posts: 261

Re: start daemon as 'nobody'

Hmmm, thank you very much for all the ideas. The idea of editing /etc/shadow sounds the "least invasive" to me but still I'm not sure whether I should go with that or not. I guess the only reason why I'm not already doing it is, that I'm kind of scared of screwing something up, because I really need my computer this and next week.
So what would you do, if you wanted to start a program (eg nxtvepg :>) at systemboot? It's just that I don't really want this program to be run under my userlogin, nor under root..

Offline

Board footer

Powered by FluxBB