Appendix C: Su and Sudo Comm ands
The su and sudo commands al low a user to execute commandsas a d ifferent user.
Su command
Using the su (switchu ser)command, auser can switch to another user acco unt to execu te
commands not authorized with t heirn ormala ccount. Ifused w ithout a username, the su
command defaults to root. Only u serswho aremembers of the wheel g roup can execute the su
command to log in as root.
NOTE: Thewh eel group is a Linux gro up and is included in the firmwar e by default.
You will be prompted for the p assword of the account you’re trying to switch to with the su
command. You will remainlo gged into th at account un til you eit her press Ctrl-D or type exit.
NOTE: Thesu command willopen a shell sessioninstead of the restrictedshell.T he user w illreceive the shell
prompt.Impr oper use of shellcommands could lead to data loss.D ouble-checkyour syntax when using shell
commands.
Syntax:
su [options][-][username[arguments]]
The following table describes op tions that can be used with the su command.
Option Description
-,-l, -- login Usesan environment similar to that hadthe user logged indirectly.
When-is used, it must be specified as the last su option.
-m,-p, - -preserve-
environment Preservesthe current en vironment.
Table C.1: Su Command Opt ions
Optional arguments may be provide d afterthe u sername,in wh ich case they are supplied to the
shell (/bin/sh).
To add a memberto the wheel group:
1. Create the user using the web manag eror CLI.
2. Open a session in the applianc ean d log in as root.
3. In the shell prompt, run the usermod command to ad d the user to the wheel group.
# usermod -G wheel <username>
4. Run the groups command to verify.
Appendices 59