Skip to content
/ sus Public

Execute the command as another user using su.

License

Notifications You must be signed in to change notification settings

wioun/sus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SuS

Execute the command as another user using su.

What's that?

This is a su-based program for executing commands on behalf of other users. It was created to simplify the use of su -c as a lightweight replacement for sudo. But unlike sudo, it asks for the target user's password instead of the current user's, and does it every time.

How to use?

For example, use:

sus whoami

The root user is used by default (the DEFAULT_USER value in sus.c).

To specify a user, use the -u argument:

sus -u admin whoami

The argument can be specified only at the beginning, otherwise it will be interpreted as part of the command to be executed.

Installation

Any su implementation that has the -c argument must be installed on the system.

Clone the repository:

git clone https://github.com/wioun/sus

Go to the repository directory:

cd sus

Compile with any convenient C compiler:

cc ./sus.c -o ./sus

Install the binary (as root):

install -m 755 ./sus /usr/bin

If you're using bash-completion, install sus_completion.bash to /etc/bash_completion.d/ (as root):

install -m 644 ./sus_completion.bash /etc/bash_completion.d/sus_completion.bash

About

Execute the command as another user using su.

Resources

License

Stars

Watchers

Forks