{q:"Which command lists all groups a user belongs to?",a:["cat /etc/group","groups username","ls -l /home","id root"],correct:"b"},
{q:"Which file defines system-wide password complexity rules on Ubuntu?",a:["/etc/security/pwquality.conf","/etc/passwd","/etc/group","/etc/shadow"],correct:"a"},
{q:"What is the purpose of the sticky bit on a directory like /tmp?",a:["Allow anyone to modify all files","Execute files with owner privileges","Only file owner can delete files in the directory","Force password expiration"],correct:"c"},
{q:"Which command safely edits the sudoers file?",a:["nano /etc/sudoers","vi /etc/sudoers","sudoedit /etc/sudoers","visudo"],correct:"d"},
{q:"How do you copy your SSH public key to a remote server?",a:["cp ~/.ssh/id_rsa.pub /remote/server","ssh-copy-id username@remote_host","scp ~/.ssh/id_rsa username@remote_host:/tmp","ssh-add ~/.ssh/id_rsa.pub"],correct:"b"},
{q:"Which chmod value sets read/write/execute for owner, read/execute for group, and no access for others?",a:["777","644","750","600"],correct:"c"},
{q:"Where are per-user password aging rules stored or managed?",a:["chage command and /etc/shadow","/etc/group","/etc/passwd only","~/.bashrc"],correct:"a"},
{q:"What is the purpose of setgid on a directory?",a:["Execute files as the directory owner","Prevent users from deleting files","Encrypt files in the directory","New files inherit the directory’s group ownership"],correct:"d"},
{q:"How do you add a user to the sudo group?",a:["sudo adduser username","sudo usermod -aG sudo username","sudo passwd username","sudo deluser username sudo"],correct:"b"},
{q:"Which command shows both user ID, primary group ID, and secondary groups?",a:["id username","groups username","whoami","cat /etc/passwd"],correct:"a"},
{q:"Which command checks and repairs a Linux filesystem?",a:["fdisk","fsck","parted","mkfs"],correct:"b"},
{q:"Which command creates or modifies disk partitions?",a:["fsck","mkfs","fdisk","df"],correct:"c"},
{q:"Where are system logs typically located?",a:["/var/log","/usr/log","/opt/log","/etc/log"],correct:"a"},
{q:"Which command lists currently scheduled cron jobs for a user?",a:["sudo crond","crontab -l","systemctl list-timers","ls /etc/cron.d"],correct:"b"},
{q:"What is the correct crontab time format order?",a:["day hour minute month weekday","month day hour minute weekday","hour minute day month weekday","minute hour day month weekday"],correct:"d"},
{q:"Where are system-wide cron jobs typically stored?",a:["/etc/crontab","/var/spool/cron","/usr/local/cron","~/.crontab"],correct:"a"},
{q:"Which file controls default password aging for new accounts?",a:["/etc/shadow","/etc/security/limits.conf","/etc/login.defs","/etc/default/useradd"],correct:"d"},
{q:"Which option in /etc/sudoers requires users to enter their password?",a:["NOPASSWD","SETENV","!requiretty","PASSWD"],correct:"d"},
{q:"Which tool views kernel and boot logs?",a:["top","sysctl","journalctl -k","dmesg -f"],correct:"c"},
{q:"What does chmod 640 file.txt do?",a:["rw for owner, r for group, none for others","rw for owner, r for all","r for owner, none for others","rwx for owner, r for group, x for others"],correct:"a"},