[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: To run a program under another user.



Sthu Deus wrote:
> Good day.
> 
> 
> I need to run a console program under another user - if I try to do so with the help of sudo - ut tells me that I'm out of the sudoers list. If I try to run it w/ the help of gksu (though weird it is) - it does so, but having started - the program soon is finished - as if the user has pressed Ctrl-D (it requires user's activity - when the user presses the combination - only then it finishes its work) - and I do not know why it happens (this "autopressing" of Ctrl-D).
> 
> So, my question is:
> 
> . if there is a way I can run the program under the wanted utility that at one hand reqquires not a sudoers list, at another - no need to run a X-application -
> 
> . if no, then how I can escape the "auto pressing" of Ctrl-D by gksu?
> 
> 
> Thank You for Your time.
> 
> 

Hi, Sthu,

It would have helped to have an example of what you're trying to do.

So, there's some guesswork here ... ;)

You could use 'su', but you must know the user password:

  (you)$ su user -c 'the command to run with arguments'
  Password:
  possible 'the command' input, with output

Otherwise, your best solution is to get 'sudo' working, which assumes
you know the password for 'root' so you can run 'visudo' to edit the
/etc/sudoers file.

You can either just add yourself, or set it up to allow a group, such as
'sudo', and then add yourself to the 'sudo' group.

Details can be found in the 'sudo' and 'sudoers' man pages, and the
'usermod' man page to add yourself to a group.  BE SURE to use the -a
option of 'usermod' when adding the group, else it clobbers your
existing group memberships.  Then run:

  sudo user command options

-- 
Bob McGowan


Reply to: