You are not logged in.

#1 2015-01-21 02:02:55

steelcowboy
Member
From: California, USA
Registered: 2014-09-04
Posts: 48

sudo sux doesn't ask for password

I am running a web server on my laptop which I also use as my primary everyday computer. I created a special user (serveradmin) that only has permission to modify the /srv directory. Therefore, when I want to use Aptana to work on my site I run

sudo sux serveradmin aptana &

However, when I run this command instead of sudo promtping a password I only get

[1] 17873

and Aptana never runs. Anyone know what's going on? Thanks!

Offline

#2 2015-01-21 03:14:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: sudo sux doesn't ask for password

I don't think you can background sudo commands - at least I can't here.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2015-01-21 03:31:22

nagaseiori
Member
Registered: 2012-09-22
Posts: 72

Re: sudo sux doesn't ask for password

You could use gksudo.

Offline

#4 2015-01-21 13:28:22

whoops
Member
Registered: 2009-03-19
Posts: 891

Re: sudo sux doesn't ask for password

What I would expect your command to do is exactly what you described: It reads nothing from nowhere in the background, where it's invisible. Or is there something I don't understand there?

I'm not sure what exactly you are trying to do with sudo AND sux. Are you using sux because you want to use X resources that don't work with sudo? If so, why use sudo at all?
Also, sux has issues with things like strg+z, strg+c and background processes (it sometimes just quits while leaving the processes running and inaccessible and stuff like that) - when in doubt, avoid those while you're using it.

What happens if you just do:

sux serveradmin

<that should prompt you for password of the user "serveradmin">
and then:

aptana

(not sure why you want it running in the background - considering how buggy sux can get with things like that, I'd suggest using 2 terminals instead)

Last edited by whoops (2015-01-21 13:29:13)

Offline

#5 2015-01-21 16:47:54

Steef435
Member
Registered: 2013-08-29
Posts: 577
Website

Re: sudo sux doesn't ask for password

You could use sudo's -b switch, as described in the manual.

EDIT: I'm not sure how this will work with sux though, never used it.

Last edited by Steef435 (2015-01-21 16:51:58)

Offline

#6 2015-01-21 17:07:42

whoops
Member
Registered: 2009-03-19
Posts: 891

Re: sudo sux doesn't ask for password

Steef435 wrote:

EDIT: I'm not sure how this will work with sux though, never used it.

sux works pretty much the same as sudo, except it also forwards x11 credentials to the user (and deals less gracefully with some key combinations, background application etc). So the only thing you'd change by using sudo's -b would probably be, that the command gets stuck in the invisible background password prompt from sux instead of the invisible background password prompt from sudo :3

Either that or it tries to transfer the nonexistant x credentials from root to the user specified in sux while still being unable to provide x credentials of the original user to the sux user... I would not recommend trying unless you don't mind rebooting afterwards.

Last edited by whoops (2015-01-21 17:13:54)

Offline

#7 2015-01-23 00:18:02

Steef435
Member
Registered: 2013-08-29
Posts: 577
Website

Re: sudo sux doesn't ask for password

I understand now, thanks for explaining!

Offline

#8 2015-01-23 02:20:54

steelcowboy
Member
From: California, USA
Registered: 2014-09-04
Posts: 48

Re: sudo sux doesn't ask for password

Thanks for all of the suggestions! Yes, I know there are plenty of alternatives, just didn't know why I'd get the output and sudo wouldn't prompt me for a password. If I run sudo [insert anything] and type my password, the sudo sux serveradmin aptana & works perfectly.

Also, the reason for sudo is so I can type my easier user password, as I gave serveradmin a much more secure password lol

I want to run it easily with an alias, so I may just change my alias to "sudo su serveradmin && aptana".
Thanks again!

Offline

Board footer

Powered by FluxBB