Creating a User Account in Linux
- Which command is used to create a new user account in Linux?
A) adduser
B) newuser
C) useradd
D) createuser
Correct Answer: C) useradd
- What option would you use with the useradd command to
specify the home directory for the new user?
A) -h
B) -d
C) -m
D) -H
Correct Answer: B) -d
- After creating a new user with useradd, which command is
typically used to set the user's password?
A) passwd
B) setpass
C) usermod
D) chpasswd
Correct Answer: A) passwd
- Which file contains the list of user accounts in a Linux system?
A) /etc/passwd
B) /etc/users
C) /etc/group
D) /etc/shadow
Correct Answer: A)
/etc/passwd
- What is the purpose of the -m option when using the useradd command?
A) To create a user with no home
directory
B) To create a home directory for
the user
C) To set the user's shell
D) To specify the user's group
Correct Answer: B) To create
a home directory for the user
- Which command would you use to delete a user account in Linux?
A) removeuser
B) deluser
C) userdel
D) deleteuser
Correct Answer: C) userdel
- What is the default shell assigned to a new user account if no shell
is specified during creation?
A) /bin/bash
B) /bin/sh
C) /bin/zsh
D) /bin/dash
Correct Answer: A) /bin/bash
- Which command can be used to modify an existing user account?
A) usermod
B) modifyuser
C) changeuser
D) edituser
Correct Answer: A) usermod
- What file is used to store encrypted passwords for user accounts?
A) /etc/passwd
B) /etc/shadow
C) /etc/group
D) /etc/security
Correct Answer: B)
/etc/shadow
- Which option with the useradd command allows you to specify
the user's primary group?
A) -g
B) -G
C) -p
D) -u
Correct Answer: A) -g
Post a Comment
If you have any doubts, please let me know