• Skip to main content
  • Skip to primary sidebar
Making Different

Making Different

Create, Learn, Build or Fix

  • Tech
  • Business
  • Relationship
  • Health
  • Travel
You are here: Home / Technology / Linux / How to Switch Users in a Linux Shell

How to Switch Users in a Linux Shell

July 30, 2021 by Nitin Maheta

how-to-switch-users-in-a-linux-shell
A shell or a command-line interpretation produces a user interface for a particular operating system. There are primarily two kinds of shells, like Unix or Linux shells.

In this article, we will discuss the different types of accounts in a Linux shell and how to switch amongst them using the ‘su’ command.

Contents

  • Different types of accounts
  • Switching users with the ‘su’ command
  • Logging in with the root account
  • Security risks that are involved with the ‘su’ command

Different types of accounts

The Linux system can be operated by three kinds of accounts: a root account, a system account, and a user account. These usually come in the rank of privileges provided with the user account at the end of the line.

Logging into a user account is the simplest of the three where all you have to know is your username and password. It is almost the same for a system account, except these accounts receive a little more benefits than the common user accounts.

The ones with the root accounts are considered no lesser than omnipotent; they can operate anything anywhere and anytime. Of course, they must be conversant with the Linux root account lingo.

It is possible to switch accounts in a Linux shell only if you have another registered account in the shell. If that account allows user logins, you can change users using the ‘su’ command. It is a long term for the super user, switch user, or substitute user.

Switching users with the ‘su’ command

To alternate user using the ‘su’ command, follow the ensuing steps:

  • Type “su -” followed by space and the username of the target user.
  • Write the password of the mentioned user.

While carrying out the procedure, if you forget to add the hyphen, then you might notice changes that would differentiate this session from the regular one.

If you wish to revert to the previous session type ‘exit’ and then press the enter button.

Logging in with the root account

Like we’ve already mentioned earlier, the ones with the root account are no less than omnipotent. They have the power to erase or create a file from the server at any point in time. Therefore, while one logs in to the root account, the Linux system ensures that they are not a hacker by requiring them to initiate the root session from another user session with the help of the ‘su’ command.

Security risks that are involved with the ‘su’ command

The security policies that the Linux systems practices are slightly different from any other interface. For example, if one wishes to switch users with the help of a ‘su’ command, they need to know the password for the separate account. While it is not a problem for a person who has two or more accounts registered to their name, this is a massive concern for professional accounts.



About Nitin Maheta

Nitin Maheta is editor in chief and webmaster of MakingDifferent Blog. You may reach him out on following social media:

Facebook | Twitter | Instagram

Primary Sidebar

Random Posts

how-to-auto-reply-in-gmail

How to Auto Reply in Gmail

By Tejas Maheta

10 First Date Questions to avoid

By Nitin Maheta

increase-adsense-income

Basic Tips To Increase Your Google AdSense Earnings

By Tejas Maheta

Divorce

How to get the best divorce matters lawyer in Denver

By Nitin Maheta

how-to-say-congratulations-for-new-home

Congratulations On Your New Home | New Home Wishes

By Nitin Maheta

All categories | About us | Contact us | Privacy policy | Disclaimer | Write for Us | Dictionary | Sitemap

The owner of this site is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com.

© 2025 Making Different