My Oracle Support Banner

User Environment Variables With SU and SUDO (Doc ID 2733910.1)

Last updated on DECEMBER 23, 2020

Applies to:

Oracle Cloud Infrastructure - Version N/A and later
Linux OS - Version Oracle Linux 6.0 and later
Information in this document applies to any platform.

Goal

su and sudo allow to execute commands or shell with a different user.

Depending on how they are invoked the environment variables can change, causing different command results.

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
 su - run a command with substitute user and group ID
 sudo - execute a command as another user


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.