User Guide
.....55
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 wheel group is a Linux group and is included in the firmware by default.
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 su command will open a shell session instead of the restricted shell. The user will receive the
shell prompt. Improper use of shell commands could lead to data loss. Double-check your syntax when
using shell commands.
Syntax:
su [options][-][username[arguments]]
The following table describes options that can be used with the su command.
Option Description
-, -l, --login
Uses an environment similar to that had the user logged in directly. When - is used, it
must be specified as the last su option.
-m, -p, --preserve-
environment
Preserves the current environment.
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.