Which of the following commands would you use to switch to a different user account?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The command that is used to switch to a different user account is "su." When you execute this command followed by a username, it initiates a new shell session under the specified user's identity. If no username is provided, it defaults to switching to the root user. This command requires the user's password for authentication, ensuring security when accessing different accounts.

In contrast, the "sudo" command allows a permitted user to execute a command as the superuser or another user, as specified by the security policy in the sudoers file. While "sudo" enables command execution under a different user, it does not start a new shell session as "su" does.

The "sh" command is used to invoke a shell interpreter but does not serve to switch user identities. The term "use" is not a standard Linux command and does not pertain to user switching. Therefore, "su" is the correct choice for switching to a different user account in a Linux environment.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy