A SERVICE OF

logo

Appendix C: Su and Sudo Commands
The su and sudo commands allow a user to execute commands as a different user.
Su command
Using the su (switch user) command, a user can switch to another user account to execute
commands not authorized with their normal account. If used without a username, the su
command defaults to root. Only users who are members of the wheel group can execute the su
command to log in as root.
NOTE: The wheelgroup isa Linuxgroup and isincluded inthe firmware bydefault.
You will be prompted for the password of the account you’re trying to switch to with the su
command. You will remain logged into that account until you either press Ctrl-D or type exit.
NOTE: The sucommand willopen a shellsession instead of therestricted shell. The user willreceive the shell
prompt. Improper useof shellcommandscould leadto data loss. Double-checkyour syntaxwhen usingshell
commands.
Syntax:
su [options][-][username[arguments]]
The following table describes options that can be used with the su command.
Option Description
-, -l,--login
Usesan environment similar to that had the user logged indirectly.
When -isused, itmust bespecified asthe last suoption.
-m, -p, --preserve-
environment
Preservesthe current environment.
Table C.1: Su Command Options
Optional arguments may be provided after the username, in which case they are supplied to the
shell (/bin/sh).
To add a member to the wheel group:
1. Create the user using the web manager or CLI.
2. Open a session in the appliance and log in as root.
3. In the shell prompt, run the usermod command to add the user to the wheel group.
# usermod -G wheel <username>
4. Run the groups command to verify.
Appendices 59