rd.git
rd.1
.\" rd - privilege elevator
.\" Copyright (C) 2022-2023 ArcNyxx <me@arcnyxx.net>
.\" see LICENCE file for licensing information
.TH RD 1 rd\-VERSION
.SH NAME
rd \- privilege elevator
.SH SYNOPSIS
.SY rd
.OP \-c
.OP \-u user
.I command
.RI [ args... ]
.YS
.SH DESCRIPTION
.BR rd (1)
is a simple privilege elevation tool.
.BR rd (1)
only allows users in the
.I GROUP
group to execute commands as different users. After verifying authorisation,
some critical environment variables are reset and
.I command
is run.
.BR rd (1)
saves the latest successful command execution time and grants password-less
authorisation if commands are executed within a certain period of time.
.BR rd (1)
accesses the controlling terminal directly rather than using stdin, allowing
.I command
to read stdin from a pipe.
.SH OPTIONS
.TP
.B \-c
Clear all environment variables before resetting critical variables.
.TP
.BI \-u\ user
Execute commands as the specified
.IR user .
Defaults to
.BR root .
.SH FILES
.TP
.I /etc/rd
Latest modification time is read for password-less authorisation.
.SH EXIT STATUS
.BR rd (1)
returns with the exit status of
.I command
on success or with 127 on failure.
.SH BUGS
.BR rd (1)
will not reset the terminal settings if interrupted during password entry and
characters will not display after being typed. To fix this, run
.BR reset (1).
The correct way to exit with failure is to enter an incorrect password.
.SH AUTHOR
Written by ArcNyxx.
.SH SEE ALSO
.BR sudo (1),\ su (1),\ doas (1),\ crypt (3),\ passwd (3),\ shadow (3),
.BR passwd (5),\ shadow (5),\ proc (5)