Introduction
Sometimes you need to do tasks as another user on your Linux system. The su command lets you switch to a different user account temporarily without logging out.
When you need to install software as the root user but are logged in as a regular user.
When you want to test commands or scripts as another user without logging out.
When you need to access files or settings that only another user can access.
When you want to switch to a less privileged user for safer testing.
When you want to run a command as another user without opening a new session.