Quantcast
Viewing latest article 1
Browse Latest Browse All 3

Answer by John Mahowald for How to su non-interactively?

Several ways to become another user.

su only works without a password if you are already root. Trying to provide a password to it on the command line is a bad idea, it will expose the credential. Don't use su.

sudo is widely deployed and free. You can deploy policy, including password-less commands, in files or LDAP.

ssh otheruser@localhost is even more widely deployed. However, you do have to have a passphrase-less key or equivalent.

ksu is useful in a Kerberos environment. If you already have a ticket you can use that.

pbrun is a part of PowerBroker, a commercial privilege product that I'm not very familiar with.

dzdo is a part of Centrify DirectAuthorize, another commercial privilege product.

doas is OpenBSD's take on execute commands as another user. It seems to have a Linux port, which is fairly recent development.

pfexec uses role based access control on Solaris. However, you tagged this question Linux.


Viewing latest article 1
Browse Latest Browse All 3

Trending Articles