Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
Question 1 of 60 · User Accounts and Groups · Easy
In Linux, what is the primary purpose of a user account?
Not quite. Try another option.
Answer: To identify and authenticate a person using the system
A user account uniquely identifies a person and controls their access and permissions on the system.
Question 2 of 60 · User Accounts and Groups · Easy
What is the numeric identifier assigned to each user account called?
Not quite. Try another option.
Answer: UID (User ID)
Each user is assigned a unique UID (User ID) that the system uses to track ownership and permissions.
Question 3 of 60 · User Accounts and Groups · Easy
What is a group in Linux primarily used for?
Not quite. Try another option.
Answer: Grouping users to share common permissions
Groups let multiple users share access rights to files and resources, simplifying permission management.
Question 4 of 60 · useradd · Easy
Which command is used to create a new user account in Linux?
Not quite. Try another option.
Answer: useradd
The useradd command creates a new user account and its associated entries in the system files.
Question 5 of 60 · useradd · Easy
Which option with useradd specifies a custom home directory for the new user?
Not quite. Try another option.
Answer: -d
The -d option sets the home directory path for the new user, for example useradd -d /home/john john.
Question 6 of 60 · useradd · Easy
Which useradd option assigns a specific UID to the new user?
Not quite. Try another option.
Answer: -u
The -u option lets you specify a numeric User ID, for example useradd -u 1050 alice.
Question 7 of 60 · userdel · Easy
Which command removes an existing user account from the system?
Not quite. Try another option.
Answer: userdel
The userdel command deletes a user account and its related entries from the system.
Question 8 of 60 · userdel · Easy
Which userdel option also removes the user's home directory and mail spool?
Not quite. Try another option.
Answer: -r
The -r option removes the user's home directory and mail spool along with the account.
Question 9 of 60 · usermod · Easy
Which command is used to modify an existing user account?
Not quite. Try another option.
Answer: usermod
The usermod command modifies properties of an existing user, such as name, group, or home directory.
Question 10 of 60 · usermod · Easy
Which usermod option is used to change a user's login name?
Not quite. Try another option.
Answer: -l
The -l option changes the login name, for example usermod -l newname oldname.
Question 11 of 60 · usermod · Easy
Which usermod option adds a user to a supplementary group without removing existing ones?
Not quite. Try another option.
Answer: -aG
Using -aG appends the user to supplementary groups; using -G alone would replace all existing supplementary groups.
Question 12 of 60 · groupadd · Easy
Which command is used to create a new group?
Not quite. Try another option.
Answer: groupadd
The groupadd command creates a new group entry in the system.
Question 13 of 60 · groupadd · Easy
Which groupadd option specifies a particular GID for the new group?
Not quite. Try another option.
Answer: -g
The -g option assigns a specific Group ID, for example groupadd -g 2000 developers.
Question 14 of 60 · groupdel · Easy
Which command deletes an existing group from the system?
Not quite. Try another option.
Answer: groupdel
The groupdel command removes an existing group from the system.
Question 15 of 60 · groupmod · Easy
Which command is used to modify an existing group's properties?
Not quite. Try another option.
Answer: groupmod
The groupmod command modifies a group, such as changing its name or GID.
Question 16 of 60 · groupmod · Easy
Which groupmod option changes the name of an existing group?
Not quite. Try another option.
Answer: -n
The -n option renames a group, for example groupmod -n newname oldname.
Question 17 of 60 · Password Management · Easy
Which command is used to change a user's password?
Not quite. Try another option.
Answer: passwd
The passwd command sets or changes a user's password.
Question 18 of 60 · Password Management · Easy
In modern Linux systems, where are the encrypted user passwords stored?
Not quite. Try another option.
Answer: /etc/shadow
Encrypted (hashed) passwords are stored in /etc/shadow, which is readable only by privileged users.
Question 19 of 60 · Important Files: /etc/passwd and /etc/group · Easy
Which file contains basic information about user accounts such as username, UID, and home directory?
Not quite. Try another option.
Answer: /etc/passwd
The /etc/passwd file stores account details including username, UID, GID, home directory, and login shell.
Question 20 of 60 · Important Files: /etc/passwd and /etc/group · Easy
Which file stores group definitions and lists the members belonging to each group?
Not quite. Try another option.
Answer: /etc/group
The /etc/group file defines groups, their GIDs, and the users who are members of each group.
Question 21 of 60 · useradd · Medium
A system administrator runs useradd -m -s /bin/bash alice. What is the combined effect of the -m and -s options?
Not quite. Try another option.
Answer: Creates the home directory and sets the login shell to /bin/bash
-m forces creation of the user's home directory, while -s specifies the login shell. Together they create alice with a home directory and /bin/bash as her shell.
Question 22 of 60 · userdel · Medium
You want to delete the user bob and also remove his home directory and mail spool. Which command achieves this?
Not quite. Try another option.
Answer: userdel -r bob
The -r option removes the user's home directory and mail spool along with the account. Without it, only the account entry is removed.
Question 23 of 60 · usermod · Medium
To add the existing user carol to the supplementary group developers without removing her from other groups, which command is correct?
Not quite. Try another option.
Answer: usermod -aG developers carol
The -a (append) flag combined with -G adds the user to a supplementary group while preserving existing memberships. Using -G alone would replace all supplementary groups.
Question 24 of 60 · Important Files: /etc/passwd and /etc/group · Medium
In /etc/passwd, an entry reads dave:x:1005:1005:Dave K:/home/dave:/bin/bash. What does the x in the second field indicate?
Not quite. Try another option.
Answer: The encrypted password is stored in /etc/shadow
An x in the password field of /etc/passwd means the actual hashed password is kept in the more secure /etc/shadow file rather than in /etc/passwd.
Question 25 of 60 · groupadd · Medium
An administrator needs to create a group named finance with a specific GID of 2000. Which command is correct?
Not quite. Try another option.
Answer: groupadd -g 2000 finance
The -g option assigns a specific GID to the new group. -u applies to user IDs, not groups, and -G is not used for setting a group's own GID.
Question 26 of 60 · Password Management · Medium
The command passwd -l user1 is executed. What is the effect on user1?
Not quite. Try another option.
Answer: The account's password is locked, preventing password-based login
passwd -l locks the password by prefixing the hash with a ! in /etc/shadow, disabling password-based authentication without deleting the account.
Question 27 of 60 · groupmod · Medium
To rename the group oldteam to newteam, which command should be used?
Not quite. Try another option.
Answer: groupmod -n newteam oldteam
The -n option specifies a new group name. The syntax is groupmod -n NEW_NAME CURRENT_NAME, so it renames oldteam to newteam.
Question 28 of 60 · groupdel · Medium
An attempt to run groupdel projects fails. Which of the following is the most likely reason?
Not quite. Try another option.
Answer: projects is the primary group of an existing user
groupdel refuses to remove a group that is still the primary group of any existing user. You must reassign or delete that user first.
Question 29 of 60 · usermod · Medium
The command usermod -L eve is run. What does this accomplish?
Not quite. Try another option.
Answer: Locks the user's password, disabling password login
usermod -L locks the account by placing a ! before the encrypted password in /etc/shadow, preventing password-based login. -U reverses this.
Question 30 of 60 · Important Files: /etc/passwd and /etc/group · Medium
A line in /etc/group reads developers:x:2001:alice,bob. What do alice and bob represent in this entry?
Not quite. Try another option.
Answer: Users who have developers as a supplementary group
The last field of an /etc/group line lists members whose supplementary (secondary) group is that group. Primary group membership is defined in /etc/passwd, not this list.
Question 31 of 60 · useradd · Medium
Which command creates a system account svc with no login shell, commonly used for running services?
Not quite. Try another option.
Answer: useradd -r -s /usr/sbin/nologin svc
-r creates a system account (lower UID range, no aging), and -s /usr/sbin/nologin prevents interactive login, which is typical for service accounts.
Question 32 of 60 · Password Management · Medium
You want to force user2 to change their password at next login. Which command sets this?
Not quite. Try another option.
Answer: passwd -e user2
passwd -e (expire) immediately expires the password, forcing the user to set a new one at their next login. -d deletes the password instead.
Question 33 of 60 · usermod · Medium
The command usermod -d /home/newdir -m frank is executed. What happens?
Not quite. Try another option.
Answer: Frank's home directory is changed and existing files are moved to /home/newdir
-d sets the new home directory path, and -m moves the contents of the current home directory to the new location.
Question 34 of 60 · Important Files: /etc/passwd and /etc/group · Medium
How many colon-separated fields does a standard entry in /etc/passwd contain?
Not quite. Try another option.
Answer: 7
Each /etc/passwd entry has 7 fields: username, password placeholder, UID, GID, GECOS (comment), home directory, and login shell.
Question 35 of 60 · groupmod · Medium
To change the GID of the group qa to 3000, which command is correct?
Not quite. Try another option.
Answer: groupmod -g 3000 qa
The -g option changes the group's numeric GID. -n changes the name and -u is not a valid groupmod option.
Question 36 of 60 · User Accounts and Groups · Medium
In Linux, what is the primary difference between a user's primary group and a supplementary group?
Not quite. Try another option.
Answer: The primary group is assigned to new files a user creates; supplementary groups grant additional access
A user's primary group is the default group ownership applied to files they create, while supplementary groups extend the user's permissions to other resources.
Question 37 of 60 · useradd · Medium
Where does useradd read default values (like default shell and home base) from when options are not specified?
Not quite. Try another option.
Answer: /etc/default/useradd and /etc/login.defs
useradd reads defaults from /etc/default/useradd and /etc/login.defs, which define values such as the default shell, home base directory, and UID ranges.
Question 38 of 60 · Password Management · Medium
The chage -l user3 command is used primarily to display what information?
Not quite. Try another option.
Answer: Password aging and expiration details for user3
chage -l lists password aging information such as last change date, expiration, and minimum/maximum password ages for the specified user.
Question 39 of 60 · User Accounts and Groups · Medium
When a new user is created without specifying a group, what typically happens on a system using the user private group (UPG) scheme?
Not quite. Try another option.
Answer: A new group with the same name as the user is created and set as the primary group
Under the User Private Group scheme (default on many distributions), each new user gets a private group named after them, enhancing file-sharing security.
Question 40 of 60 · Important Files: /etc/passwd and /etc/group · Medium
A user account has the shell field in /etc/passwd set to /usr/sbin/nologin. What is the practical effect?
Not quite. Try another option.
Answer: The user cannot obtain an interactive login shell
Setting the login shell to /usr/sbin/nologin prevents the user from getting an interactive shell, which is common for service or system accounts.
Question 41 of 60 · Important Files: /etc/passwd and /etc/group · Hard
A line in /etc/passwd reads:
john:x:1005:1005::/home/john:/sbin/nologin
What is the practical consequence of the final field combined with the second field?
Not quite. Try another option.
Answer: Authentication is delegated to /etc/shadow and interactive login is denied
The x in the second field means the hashed password lives in /etc/shadow, not /etc/passwd. The shell /sbin/nologin denies interactive login while still allowing the account to own processes/files and run services.
Question 42 of 60 · usermod · Hard
A user dev currently belongs to groups dev, docker, and sudo. An admin runs:
usermod -G project dev
What happens to the user's group membership?
Not quite. Try another option.
Answer: The user is removed from docker and sudo and left only in dev and project
usermod -G replaces the entire list of supplementary groups. Without -a (append), docker and sudo are stripped. The primary group dev (in /etc/passwd) is unaffected.
Question 43 of 60 · useradd · Hard
An admin wants to create a system account backup with no login shell, no home directory creation, and a UID below 1000. Which command is correct?
Not quite. Try another option.
Answer: useradd -r -s /usr/sbin/nologin -M backup
-r creates a system account (UID from the system range, typically below 1000) and by default does not create a home directory. -M explicitly prevents home creation and nologin disables interactive login. The other options create a home dir or use a normal UID range.
Question 44 of 60 · userdel · Hard
A user alice is currently logged in with a running process. An admin runs userdel -r alice. What is the most likely outcome?
Not quite. Try another option.
Answer: userdel warns that the user is currently logged in but still removes the account entry and home directory
By default userdel warns (user alice is currently logged in) but proceeds to remove the account. -r also deletes the home directory and mail spool. It does not automatically terminate running processes; use -f to force removal despite the login.
Question 45 of 60 · Password Management · Hard
In /etc/shadow, a user's entry has the fields ... :18000:0:90:7:14: :. What does the value 14 (the sixth field after last-change) represent?
Not quite. Try another option.
Answer: The number of days after expiration before the account is disabled
The shadow fields in order are: last-change, min, max, warn, inactive, expire. After max (90) and warn (7), the fifth field (14) is the inactivity period — days after password expiry before the account is locked.
Question 46 of 60 · groupmod · Hard
A group staff has GID 1010. An admin runs groupmod -g 1200 staff. Which statement about existing files is correct?
Not quite. Try another option.
Answer: Files owned by GID 1010 now show an orphaned numeric GID and must be manually re-owned
File ownership is stored as a numeric GID on the inode, not the group name. Changing the group's GID does not update existing files, so they display the old numeric GID (now unmapped) until chgrp/find -exec chgrp fixes them.
Question 47 of 60 · User Accounts and Groups · Hard
Two users, bob (UID 1002) and carol (UID 1002), both appear in /etc/passwd with the same UID. What is the security/functional implication?
Not quite. Try another option.
Answer: Both accounts are treated by the kernel as the same identity with identical file permissions
The kernel identifies users by numeric UID, not name. Two names sharing a UID are indistinguishable at the permission level — each can read/write the other's files. useradd blocks this by default, but manual edits or -o allow non-unique UIDs.
Question 48 of 60 · groupadd · Hard
An admin needs to create a group ops with a specific GID 600, but GID 600 is already in use. Which command creates the group while allowing the duplicate GID?
Not quite. Try another option.
Answer: groupadd -o -g 600 ops
The -o (--non-unique) flag permits creating a group with a GID that already exists. Plain -g 600 fails on conflict, -f (force) exits successfully but does NOT create a duplicate-GID group, and -r only affects system-range GID selection.
Question 49 of 60 · Password Management · Hard
An admin runs passwd -l alice followed by passwd -S alice, which shows status L. What exactly did the lock do?
Not quite. Try another option.
Answer: Prepended a ! to the password hash, making no hash match during authentication
passwd -l locks by prefixing ! (or !!) to the stored hash in /etc/shadow. Since no supplied password can hash to a string starting with !, password auth fails. The original hash is preserved and restored with passwd -u. It does not change the shell or expiry.
Question 50 of 60 · usermod · Hard
An admin wants to change user sam's home directory to /data/sam AND move the existing files. Which single command achieves both?
Not quite. Try another option.
Answer: usermod -m -d /data/sam sam
-d sets the new home directory path, but only -m (move) relocates the contents of the old home to the new location. Using -d alone updates /etc/passwd but leaves files behind. -b sets a base directory (used with useradd defaults).
Question 51 of 60 · Important Files: /etc/passwd and /etc/group · Hard
In /etc/group, the entry wheel:x:10:root,admin lists members. If user admin also has wheel as their primary group in /etc/passwd, will admin appear in the groups admin output for wheel?
Not quite. Try another option.
Answer: Yes, wheel appears because it is both the primary group and a listed supplementary member
groups reports the primary group (from /etc/passwd) plus all supplementary groups (from /etc/group). Being listed in both simply means wheel shows once; there is no conflict, and it does not require conversion tools.
Question 52 of 60 · useradd · Hard
Given /etc/default/useradd defines SHELL=/bin/bash and /etc/login.defs sets CREATE_HOME yes, an admin runs useradd -s /bin/zsh dan. Which shell and home behavior result?
Not quite. Try another option.
Answer: Shell /bin/zsh; home directory created
The explicit -s /bin/zsh overrides the default shell. CREATE_HOME yes in login.defs causes the home directory to be created even without -m. So the account gets /bin/zsh and a home directory.
Question 53 of 60 · groupdel · Hard
An admin attempts groupdel developers, but the command fails. developers is the primary group of user eve. Why does it fail?
Not quite. Try another option.
Answer: You cannot remove the primary group of an existing user
groupdel refuses to delete a group that is the primary group of any existing user (error: cannot remove the primary group of user 'eve'). You must first change eve's primary group with usermod -g. Supplementary membership alone does not block deletion.
Question 54 of 60 · Password Management · Hard
An admin runs chage -M 60 -W 10 -I 5 frank. If frank's password was last changed on day 0, on which day (approximately) does the account become inactive/locked?
Not quite. Try another option.
Answer: Day 65
-M 60 means the password expires on day 60. -I 5 sets a 5-day inactivity grace after expiry before the account is locked, so it becomes inactive around day 65. -W 10 only controls when warnings begin (day 50) and does not affect the lock date.
Question 55 of 60 · usermod · Hard
An admin runs usermod -L -e 1 grace. What is the combined effect?
Not quite. Try another option.
Answer: Locks the password AND expires the account (day 1 from epoch), disabling all login methods
-L locks the password (like passwd -l), but SSH key logins could still work. -e 1 sets the expiry date to day 1 after 1970-01-01 (long past), which disables the account entirely regardless of authentication method. Combined, all logins are blocked.
Question 56 of 60 · Important Files: /etc/passwd and /etc/group · Hard
A corrupted /etc/passwd line reads:
henry:x:1007:1007:Henry:/home/henry
What is the effect of the missing seventh field?
Not quite. Try another option.
Answer: The system substitutes /bin/sh (or /bin/bash) as the default shell
When the shell (7th) field is empty or absent, login programs default to /bin/sh. The line is still parsed with six fields; the missing shell simply triggers the default rather than breaking the entry.
Question 57 of 60 · User Accounts and Groups · Hard
A user needs group data's permissions for a new file they just created, but their session started before they were added to data via usermod -aG data user. Why does newgrp data help but re-login does not immediately?
Not quite. Try another option.
Answer: Group membership is loaded at session start, so the current shell's credentials are stale until newgrp starts a new shell with updated groups
Supplementary group memberships are set when a session/process starts. An already-running shell keeps its stale credential set. newgrp data spawns a new shell that reads the updated /etc/group, activating the membership. Logging out and back in also works, but not for the already-running session.
Question 58 of 60 · groupmod · Hard
An admin runs groupmod -n engineers devs. After this, what is true about files previously owned by group devs?
Not quite. Try another option.
Answer: Files remain correctly group-owned because only the name changed, not the GID
groupmod -n renames the group but keeps the same GID. Since file inodes store the numeric GID, ownership stays valid and files simply show the new name engineers. No re-chgrp is needed (unlike changing the GID with -g).
Question 59 of 60 · userdel · Hard
After running userdel ivan (without -r), an admin creates a new user julia who receives ivan's old UID. What risk exists regarding ivan's leftover files?
Not quite. Try another option.
Answer: Julia automatically owns and can access ivan's old files because the UID matches
Without -r, ivan's files remain on disk tagged with his numeric UID. Ownership is by UID, not name, so when julia is assigned the same UID she inherits ownership of those orphaned files — a common security oversight. Using userdel -r or finding orphaned files avoids this.
Question 60 of 60 · useradd · Hard
An admin runs useradd -u 0 -o -g 0 shadowroot. What is the outcome and its significance?
Not quite. Try another option.
Answer: It creates a second account with full root privileges due to UID 0
The -o flag allows a non-unique UID, and UID 0 is what defines superuser privileges — not the username. shadowroot therefore has full root access, which is a serious backdoor risk. The kernel grants privileges based on UID 0, regardless of the account name.
That's unit 7
Answer a few questions and your score shows up here.
Nearly through. Did unit 7 of CSE105 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 7 of CSE105 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.