0
0
Bash Scriptingscripting~10 mins

User account management script in Bash Scripting - Interactive Code Practice

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

Complete the code to add a new user named 'john'.

Bash Scripting
sudo useradd [1]
Drag options to blanks, or click blank then click option'
A-m john
Bjohn
C-d /home/john
D-s /bin/bash
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to create the home directory with '-m'.
Using only the username without options.
2fill in blank
medium

Complete the code to delete a user named 'alice' and remove her home directory.

Bash Scripting
sudo userdel [1]
Drag options to blanks, or click blank then click option'
A-d alice
Balice
C-f alice
D-r alice
Attempts:
3 left
💡 Hint
Common Mistakes
Deleting the user without removing the home directory.
Using incorrect options like '-d' which is not valid here.
3fill in blank
hard

Fix the error in the script that locks the user account 'bob'.

Bash Scripting
sudo passwd [1] bob
Drag options to blanks, or click blank then click option'
A-l
B-u
C-d
D-e
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-u' which unlocks the account instead.
Using '-d' which deletes the password.
4fill in blank
hard

Fill both blanks to create a user 'carol' with home directory and bash shell.

Bash Scripting
sudo useradd [1] [2] carol
Drag options to blanks, or click blank then click option'
A-m
B-s /bin/bash
C/bin/bash
D-d
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-d' instead of '-m' for home directory.
Not specifying the shell option.
5fill in blank
hard

Fill all three blanks to create a user 'dave' with home directory, bash shell, and add to group 'developers'.

Bash Scripting
sudo useradd [1] [2] [3] dave
Drag options to blanks, or click blank then click option'
A-m
B-s /bin/bash
C-G developers
D/bin/bash
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to add the user to the 'developers' group.
Using the shell path as an option instead of a value.