Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
RUNAS(1)		     General Commands Manual			RUNAS(1)

NAME
     RUNAS - Run commands as another user

SYNOPSIS
     runas username [su flags] command [arguments]
     asroot [su flags] command [arguments]

PURPOSE
     runas is a simple wrapper around su to add convenience for running commands
     as another user.

     asroot command is equivalent to runas root command.

     The  primary  goal is to make su convenient enough to serve as a substitute
     for sudo.	Several serious security bugs have been discovered in  sudo  in-
     cluding  one that persisted for about a decade before being publicized.  In
     addition, configuring multiple sudo users increases the  odds  for  hackers
     cracking a password that gives them root access.

DESCRIPTION
     The  su  command  is  commonly used to run a shell session as another user.
     However, if we only intend to run a single command as that user, it is bet-
     ter for security if we do not start a  shell,  which  we  might  forget  to
     close.   This is the primary argument for using sudo instead of su.  We ac-
     tually can use su to run a single command, but it is a bit cumbersome as it
     requires additional flags as well as quotes around commands with any  argu-
     ments, e.g.

     su -l root -c 'command -flag arg1 arg2'

     The runas command simply eliminates the annoying cruft:

     runas root command -flag arg1 arg2

     The runas command differs from sudo in the following ways:

     o	It  requires  the target user's password rather than the password of the
     invoking user.  This means that there is only one password  to  allow  root
     access and helps prevent that password from being forgotten.  Users of sudo
     often forget or never know the root password, which can become a problem if
     it  is  misplaced and needed for some reason (such as a sudo user's account
     becoming inaccessible).

     o It does not require any system configuration.  To run a	command  as  an-
     other  user,  one	must  simply know the password (unless invoking runas as
     root, of course).

     o It does not cache passwords: Every invocation requires the target  user's
     password.

SEE ALSO
     su, sudo

BUGS
     Please  report  bugs to the author and send patches in unified diff format.
     (man diff for more information)

AUTHOR
     J. Bacon

									RUNAS(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=asroot&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help