View previous topic :: View next topic |
Author |
Message |
ths n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 14 Nov 2002 Posts: 2
|
Posted: Thu Nov 14, 2002 11:00 pm Post subject: Run a command for a non root user with su |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
reves Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/8552196234044f2abaed6f.jpg)
Joined: 25 Jun 2002 Posts: 215 Location: South Florida
|
Posted: Thu Nov 14, 2002 11:35 pm Post subject: |
|
|
I beleive it should be Code: | su [user] -c [command] |
_________________ Robert |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
zhenlin Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 09 Nov 2002 Posts: 1361
|
Posted: Fri Nov 15, 2002 10:04 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
reves Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/8552196234044f2abaed6f.jpg)
Joined: 25 Jun 2002 Posts: 215 Location: South Florida
|
Posted: Fri Nov 15, 2002 3:25 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
darktux Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/d5e4bdd03dfd1b80db613.jpg)
Joined: 16 Nov 2002 Posts: 1086 Location: Coimbra, Portugal
|
Posted: Sat Nov 16, 2002 5:17 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
puddpunk l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/7188255843f00221d1a238.jpg)
Joined: 20 Jul 2002 Posts: 681 Location: New Zealand
|
Posted: Sun Nov 17, 2002 8:12 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
ths n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 14 Nov 2002 Posts: 2
|
Posted: Sun Nov 17, 2002 8:29 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Stormmind Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/18249974573ffd8d2095fa9.jpg)
Joined: 11 Aug 2002 Posts: 112 Location: Sweden
|
Posted: Wed Nov 20, 2002 10:18 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Sassur n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/c2ec781f3d9ae3dc8abf9.png)
Joined: 04 Jul 2002 Posts: 25 Location: Hägersten/Stockholm/Sweden
|
Posted: Wed Nov 20, 2002 10:51 am Post subject: |
|
|
Is the user witch you try to "su -" with a member of the wheel group? _________________ Fredrik |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
reves Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/8552196234044f2abaed6f.jpg)
Joined: 25 Jun 2002 Posts: 215 Location: South Florida
|
Posted: Thu Nov 21, 2002 7:03 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|