nerdexam
CompTIA

XK0-005 · Question #31

A Linux administrator needs the "tech" account to have the option to run elevated commands as root. Which of the following commands would BEST meet this goal?

The correct answer is B. # usermod -aG wheel tech. On Red Hat-based systems (RHEL, CentOS, Fedora), membership in the 'wheel' group grants a user the ability to use 'sudo' to run elevated commands as root. 'usermod -aG wheel tech' appends (-a) the 'tech' user to the supplementary group (-G) 'wheel', giving them sudo access…

System Management

Question

A Linux administrator needs the "tech" account to have the option to run elevated commands as root. Which of the following commands would BEST meet this goal?

Options

  • A$ su - tech -c "/bin/bash"
  • B

    usermod -aG wheel tech

  • C

    sudo -I tech

  • D

    groupadd -u tech -g root

How the community answered

(24 responses)
  • A
    4% (1)
  • B
    71% (17)
  • C
    8% (2)
  • D
    17% (4)

Explanation

On Red Hat-based systems (RHEL, CentOS, Fedora), membership in the 'wheel' group grants a user the ability to use 'sudo' to run elevated commands as root. 'usermod -aG wheel tech' appends (-a) the 'tech' user to the supplementary group (-G) 'wheel', giving them sudo access without changing their primary group. Option A ('su - tech -c "/bin/bash"') switches to the tech user's environment and runs bash - it does not grant elevated privileges. Option C ('sudo -I tech') is not a valid sudo flag combination for granting persistent elevated access. Option D ('groupadd -u tech -g root') misuses the groupadd flags and does not correctly add 'tech' to the root group.

Topics

#User Management#Linux Groups#sudo#Privilege Escalation

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice