A Linux administrator needs to add a new user named 'jdoe' with a home directory and a bash shell. Which command accomplishes this?
Trap 1: usermod -m -s /bin/bash jdoe
usermod modifies existing users; jdoe does not exist yet.
Trap 2: adduser jdoe --home /home/jdoe --shell /bin/bash
adduser is a Perl script that may not be available on all distributions; useradd is the standard.
Trap 3: passwd -m jdoe
passwd changes passwords; -m is not a valid option.
- A
usermod -m -s /bin/bash jdoe
Why wrong: usermod modifies existing users; jdoe does not exist yet.
- B
adduser jdoe --home /home/jdoe --shell /bin/bash
Why wrong: adduser is a Perl script that may not be available on all distributions; useradd is the standard.
- C
useradd -m -s /bin/bash jdoe
This creates the home directory and sets the shell.
- D
passwd -m jdoe
Why wrong: passwd changes passwords; -m is not a valid option.