Mailinglist Archive: opensuse (946 mails)

< Previous Next >
Re: [opensuse] Run command as another user
Simon & Paul, et al --

...and then Simon Heimbach said...
% Am 29.09.2017 um 16:56 schrieb Paul Groves:
% > I believe everyone is getting confused. I do not want root access, nor
% > can I obtain root access. There is a script which is run from a standard
% > So I was thinking that I could make a small C / C++ program. In the
% > script I could call llike this:
% > cprogram --user bob --pasword bobspassword

Paul, to become bob in this way will basically require root, because
you're still changing user context. This probably isn't where you can go.

% >
% > There must be a way to do this somehow...
% Well, no. We're not confused.
% We're discussing ways how you can get your program been run under user
% "bob". You can 1) use "expect" in a bash-script and then execute your
% program from there or 2) create a sudo-exception, log in as root and
% then run sudo --user bob as you don't need credentials for another user
% as root.

... or 3) just ssh in as bob and let the OS take care of authentication
and user switching and just run the program.

You mentioned, though, that "bob" has sudo access and that you want to
have the bob account run the elevated-access program. Note that sudo
often requires that one authenticate, which very well might put you back
in the expect(1) world.

The more detail you can give us, the better we can provide ideas :-)


David T-G

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
List Navigation
Follow Ups