0
0
Linux CLIscripting~10 mins

useradd and userdel in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to add a new user named 'alice'.

Linux CLI
sudo [1] alice
Drag options to blanks, or click blank then click option'
Auseradd
Buserdel
Cpasswd
Dgroupadd
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'userdel' instead of 'useradd'.
Using 'passwd' which changes passwords, not adds users.
2fill in blank
medium

Complete the command to delete a user named 'bob'.

Linux CLI
sudo [1] bob
Drag options to blanks, or click blank then click option'
Apasswd
Buserdel
Cgroupdel
Duseradd
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'useradd' instead of 'userdel'.
Using 'groupdel' which deletes groups, not users.
3fill in blank
hard

Fix the error in the command to add a user with a home directory.

Linux CLI
sudo useradd [1] alice
Drag options to blanks, or click blank then click option'
A-m
B-r
C-s
D-d
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-d' which sets a custom home directory path but does not create it.
Using '-r' which creates a system user, not a regular user.
4fill in blank
hard

Fill both blanks to delete user 'charlie' and remove their home directory.

Linux CLI
sudo [1] [2] charlie
Drag options to blanks, or click blank then click option'
Auserdel
B-r
C-m
Duseradd
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'useradd' instead of 'userdel'.
Using '-m' which creates a home directory, not removes it.
5fill in blank
hard

Fill all three blanks to add a user 'dave' with a home directory and set their shell to /bin/bash.

Linux CLI
sudo [1] [2] [3] dave
Drag options to blanks, or click blank then click option'
A-m
B-s
Cuseradd
D-r
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-r' which creates a system user, not a regular user.
Putting options in the wrong order or missing the shell option.