Which command would you use if you want to change to another user account in Linux?

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 "su" is used to switch user accounts in Linux, allowing a user to assume the identity of another user. When executed, it prompts for the password of the target user and, upon successful authentication, provides a shell with that user's privileges. This command is particularly useful for system administrators who need to perform tasks that require different user permissions without logging out of their current session.

While "sudo" also allows a user to execute commands with elevated privileges, it is primarily designed to run a single command as another user, typically root, rather than switching into an entirely new user session. "sudoedit" is a specific command used for editing files with elevated privileges, and "visudo" is a command for safely editing the sudoers file. These two options cater to specific use cases but do not facilitate switching users in an interactive manner.

This makes "su" the most appropriate choice for changing to another user account in Linux.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy