i---login Verified current stable Not installed? System Operations

I Login / Launch Shell As Superuser Login

Launch Shell As Superuser Login

Initiate a login shell for superuser to perform administrative tasks as root.

$
Terminal
sudo -i

When To Use

When comprehensive administrative configuration or troubleshooting is required beyond typical user commands.

Pro Tip

Include `-i` in scripts to force a login shell for complete environment initialization.

Anatomy of Output

Understanding the result

root@hostname:~# Prompt in Superuser Shell

Indicates successful escalation to root user.

export PS1='[admin: 31395]$ ' Prompt Customization

Shows configuration of the shell prompt for the root account.

# Groups: root admin users Current Group Membership

Displays groups associated with the superuser.

Troubleshooting

Common pitfalls

sudo: unable to resolve hostname: hostname

Solution: Ensure the system hostname is correctly set in `/etc/hosts`.

bash: cannot set terminal process group

Solution: Check terminal settings or reconnect to the terminal.

sudo: command not found

Solution: Install sudo package if it's missing or not in the path.

Command Breakdown

What each part is doing

sudo
Base Command
The executable that performs this operation. Here it runs I Login before the shell applies any redirect operators.
-i
i| login
The value supplied for i| login.
-i
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative system operations tools for the same job.