Mailinglist Archive: opensuse (783 mails)

< Previous Next >
Re: [opensuse] Run command as another user
On 2017-10-02 15:02, Paul Groves wrote:

On 30/09/17 00:33, Carlos E. R. wrote:
On 2017-09-29 22:36, David T-G wrote:

The more detail you can give us, the better we can provide ideas :-)
He said he wants to do this in C:

system("command", username, password);

Plain simple :-)


I don't know of a way to call a command giving user and password in its
command line. Except expect. Or ssh with key pairs, not password.
SSH is rather unnecessary as it only needs access to the local machine.

still, ssh can run against the same local machine, it can work
passwordless, and it does not require "root" to configure it. So it is
your best chance.



Is there a way of logging into a local shell as a user in C to run the
commands?

As far as I know (which is limited), no.

--
Cheers / Saludos,

Carlos E. R.
(from 42.2 x86_64 "Malachite" at Telcontar)

< Previous Next >
List Navigation
References