sui
Switch user identity with or without login
TLDR
Execute a Sui subcommand
Build tools for a smart contract
Publish smart contracts, get object information, execute transactions and more
Start a local network
Update from source
SYNOPSIS
sui username [command]
PARAMETERS
username
The username of the user whose identity you want to assume.
[command]
The command to execute as the specified user. If omitted, a new shell is started.
DESCRIPTION
The sui command allows a user to execute a specified command with the identity of another user. This differs from sudo in that sui typically requires the user to know the target user's password. It is designed for situations where users need to temporarily perform tasks as another user without gaining permanent elevated privileges. This command is rarely seen on modern Linux systems because sudo has become the preferred method for privilege elevation.
The command requires the password of the target user to proceed. If provided correctly, the specified command is executed with the user ID and group ID of the specified user. If the command is omitted, a new shell is started under the target user's identity.
CAVEATS
sui is considered less secure than sudo and is rarely used in modern Linux distributions. The main reason is that it requires knowledge of the target user's password, potentially leading to security risks if the password is compromised. sudo provides more granular control and auditing capabilities.
SECURITY CONSIDERATIONS
Using sui increases the risk of password compromise. If the target user's password is weak or becomes known to unauthorized individuals, they can easily assume that user's identity. sudo's policy-based access control provides a more secure and auditable alternative.
ALTERNATIVES
sudo is the preferred alternative for most privilege elevation tasks. It allows administrators to grant specific permissions to users, enabling them to execute certain commands as root or another user without needing to know the root password or the target user's password. su also allows switching to another user, but usually requires root privileges to switch to any user other than the current one.
HISTORY
sui was prevalent in older Unix systems as a simple mechanism for switching user identities. Its use has significantly declined with the widespread adoption of sudo, which offers better security features and access control. Modern distributions often don't include sui by default, favoring sudo for privilege management.