How to switch users in Linux

Linux user switching

Learn how to switch users in Linux with ease. One simple method is using the ‘su’ command, allowing swift transition to the admin account within your current session. This proves helpful, particularly when the root user faces login issues via SSH or the GUI display manager.

Here are some other articles relating to automatic logon: How to enable or disable automatic login on macOS, how to prevent MacBook from automatically Logging outImplementation of Kiosk Mode using Local Settings: Single App Kiosk Setup, how to start an application automatically on macOS, and how to disable automatic screen lock on Ubuntu Desktop with the GUI and dconf Editor.

How to switch users in Linux on the command line using "sudo su"

Looking to enhance your Linux skills? Discover the power of Su, also known as substitute user or switch user. Learn how to switch users in Linux effectively, allowing you to execute commands with different user privileges. When using Su, you can invoke a shell without altering the working directory or the user environment.

root@test-VirtualBox:~# su test

Changing to the root user

test@test-VirtualBox:/$ sudo -i

I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.

Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x