• HOME
  • TECH BLOG
  • MIGRATING TO AMAZON WEB SERVICES
  • IT PROJECT MANAGEMENT BLOG
  • Q&A
  • INTERACTIVE LEARNING
Pop-up Preset:








HOW TO SWITCH USERS IN A LINUX SHELL



​



HOW TO SWITCH USERS IN A LINUX SHELL



The su Command allow you to change to a different user .

Type "su -" followed by a space and the username.

The user changes from root to ec2-user.



THE ROOT ACCOUNT



The Root Account. Only a few experienced and trusted users can typically log in as the root user on most Linux systems, because the root user can read, modify and delete any file or setting on the server. To prevent a hacker from logging in as "root," many Linux systems require that a root session be initiated from another user session with the "su" command. When you type "su -" without a username and press "Enter," the system assumes you want to log in as the root user and prompts you for the root user password.



The sudo Utility



changes ownership



A utility named "sudo" is a popular and more secure alternative to the su command. A sudo configuration file contains a list of users who can switch to other accounts, such as the root account. When a user prefixes a command with the word "sudo," he's prompted for his own password, and the system executes only that command as the root user. With sudo, there's no risk of compromising the root password or forgetting to log out of the root account.


more

CERTIFIED CLOUD EXPERTS | AWS PARTNER NETWORK
CLOUD CONSULTING FIRM | (516) 387-2085 | CONTACT US