Linux User Management
How to create a new user in linux ?
Answer : sudo useradd <username>
eg : sudo useradd Alexa
How to set a password for user ?
Answer : sudo passwd <username>
eg: sudo passwd Alexa
How to specify home directory path for a new user while user creation ?
Answer : Use -d option . eg: sudo useradd -d /home/test_user test_user
How to create a user without a home directory ?
Answer : use -M option . eg: sudo useradd -M test_user
How to switch to another user ?
Answer :
whoami user1 $ su - user2 Password: $ whoami user2 $ exit logout