How to create a user without useradd command?
2. What is the default permission on user's home directory?
3. What is the difference between .bash_profile and .bashrc?
In case you are already logged in and you open a new terminal then .bashrc file is executed
4. What is the command to create a user with a pre defined uid, shell and home directory?
5. Explain each field of /etc/passwd
1st field: username
2nd field: x tells that an encrypted password is stored in /etc/shadow
3rd field: uid
4th field: gid
5th field: Description
6th field: home directory
7th field: default login shell
6. How to change primary group for any user?
7. If I delete a user, does it's home directory gets deleted? If not then what is the command to delete the home directory of user along with the user
# userdel -r username
8. Name any 3 files which are automatically created inside any user's home directory when a user is added
9. What is the command to view all the currently logged in users?
10. What is the command to change and view the expiry date for any user?
11. What are the details you get with finger command?
12. How can you give a normal user all the root level privileges?
Add the user to wheel group and uncomment the wheel group line in sudoers file
Give the user all command permission in sudoers
How to give normal user root privileges using sudo in Linux/Unix
13. Name any 3 groups of which root is a member by default
14. How can you give sudo access to any user without asking him to provide passord every time he runs a command?
15. Why do we use visudo rather than editing the file with vi or any other editor?
A guide on visudo and its usage