Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Run a command for a non root user with su
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ths
n00b
n00b


Joined: 14 Nov 2002
Posts: 2

PostPosted: Thu Nov 14, 2002 11:00 pm    Post subject: Run a command for a non root user with su Reply with quote

Hello,

at boottime I want to start a daemon, which should not run as root.
Normally I d this with
su <user> <command>
or
su - <user> <command>
But this doesn't work with my gentoo 1.2
I only get for the command:
<command>: <command_with_path>: cannot execute binary file

Does anybody know how to solve this problem ?

regards,

ths
_________________
Thomas Scheuermann
Karlsdorf Germany
Back to top
View user's profile Send private message
reves
Apprentice
Apprentice


Joined: 25 Jun 2002
Posts: 215
Location: South Florida

PostPosted: Thu Nov 14, 2002 11:35 pm    Post subject: Reply with quote

I beleive it should be
Code:
 su [user] -c [command]

_________________
Robert
Back to top
View user's profile Send private message
zhenlin
Veteran
Veteran


Joined: 09 Nov 2002
Posts: 1361

PostPosted: Fri Nov 15, 2002 10:04 am    Post subject: Reply with quote

I believe it should be su - -c 'command'. Notice the quotes.

Or, if you have sudo, you might want to try that... No messing around with the quotes, although you might have to set NOPASSWD: ALL for root.
Back to top
View user's profile Send private message
reves
Apprentice
Apprentice


Joined: 25 Jun 2002
Posts: 215
Location: South Florida

PostPosted: Fri Nov 15, 2002 3:25 pm    Post subject: Reply with quote

Quote:
I believe it should be su - -c 'command'. Notice the quotes.

Or, if you have sudo, you might want to try that... No messing around with the quotes, although you might have to set NOPASSWD: ALL for root.


I beleive he wants to run a program as a user other than root so it would be
Code:
su [user] -c [command]

The quotation marks would only be needed if the command contained spaces.
_________________
Robert
Back to top
View user's profile Send private message
darktux
Veteran
Veteran


Joined: 16 Nov 2002
Posts: 1086
Location: Coimbra, Portugal

PostPosted: Sat Nov 16, 2002 5:17 pm    Post subject: Reply with quote

Is it too hard to do make su? I mean... jiz...

Code:
SU(1)                            User Commands                           SU(1)

NAME
       su - run a shell with substitute user and group IDs

      -c, --commmand=COMMAND
             
 pass a single COMMAND to the shell with -c
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Sun Nov 17, 2002 8:12 am    Post subject: Reply with quote

Quote:
Is it too hard to do make su? I mean... jiz...

Code:
SU(1)                            User Commands                           SU(1)
 
 NAME
        su - run a shell with substitute user and group IDs
 
       -c, --commmand=COMMAND
               
 pass a single COMMAND to the shell with -c


Code:
chris@chris chris $ make su
make: *** No rule to make target `su'.  Stop.
chris@chris chris $


:(

what kind of crazy symlinks do you have in your bin dirs? jiz!
Back to top
View user's profile Send private message
ths
n00b
n00b


Joined: 14 Nov 2002
Posts: 2

PostPosted: Sun Nov 17, 2002 8:29 pm    Post subject: Reply with quote

Hello,

thanks for your help.

su - <user> -c <command>

was the thing I searched. My manpage on gentoo didn't
tell me anything about this.

Thanks for your help

ths
_________________
Thomas Scheuermann
Karlsdorf Germany
Back to top
View user's profile Send private message
Stormmind
Tux's lil' helper
Tux's lil' helper


Joined: 11 Aug 2002
Posts: 112
Location: Sweden

PostPosted: Wed Nov 20, 2002 10:18 am    Post subject: Reply with quote

Can someone tell me why I can't su on my computer?
When I try "su -" for instance, I get Permission denied.
The password is correct. "su - root" does the same.
The only way I'm allowed to connect is either through
a login prompt or an ssh-session.

// Storm
Back to top
View user's profile Send private message
Sassur
n00b
n00b


Joined: 04 Jul 2002
Posts: 25
Location: Hägersten/Stockholm/Sweden

PostPosted: Wed Nov 20, 2002 10:51 am    Post subject: Reply with quote

Is the user witch you try to "su -" with a member of the wheel group?
_________________
Fredrik
Back to top
View user's profile Send private message
reves
Apprentice
Apprentice


Joined: 25 Jun 2002
Posts: 215
Location: South Florida

PostPosted: Thu Nov 21, 2002 7:03 am    Post subject: Reply with quote

Stormmind wrote:
Can someone tell me why I can't su on my computer?
When I try "su -" for instance, I get Permission denied.
The password is correct. "su - root" does the same.
The only way I'm allowed to connect is either through
a login prompt or an ssh-session.

// Storm


You may want to see this post .
_________________
Robert
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum