0
0
Cybersecurityknowledge~10 mins

Linux security fundamentals in Cybersecurity - Interactive Code Practice

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

Complete the code to display the current user in Linux.

Cybersecurity
echo [1]
Drag options to blanks, or click blank then click option'
A$USER
B$HOME
C$SHELL
D$PATH
Attempts:
3 left
💡 Hint
Common Mistakes
Using $HOME which points to the user's home directory.
Using $PATH which lists executable search paths.
2fill in blank
medium

Complete the command to change file permissions to read, write, and execute for the owner only.

Cybersecurity
chmod [1] filename
Drag options to blanks, or click blank then click option'
A700
B777
C755
D644
Attempts:
3 left
💡 Hint
Common Mistakes
Using 777 which gives all permissions to everyone.
Using 644 which does not allow execute permission.
3fill in blank
hard

Fix the error in the command to list all files including hidden ones.

Cybersecurity
ls [1]
Drag options to blanks, or click blank then click option'
A-r
B-l
C-h
D-a
Attempts:
3 left
💡 Hint
Common Mistakes
Using -l which lists files in long format but does not show hidden files.
Using -h which shows sizes in human-readable format.
4fill in blank
hard

Fill both blanks to create a user and set a password in Linux.

Cybersecurity
[1] newuser && [2] newuser
Drag options to blanks, or click blank then click option'
Aadduser
Bpasswd
Cuserdel
Dusermod
Attempts:
3 left
💡 Hint
Common Mistakes
Using userdel which deletes a user.
Using usermod which modifies user properties but does not create.
5fill in blank
hard

Fill all three blanks to create a dictionary of users and their home directories, filtering only users with home starting with '/home'.

Cybersecurity
users = [1]: [2] for [3] in open('/etc/passwd') if [2].startswith('/home')}}
Drag options to blanks, or click blank then click option'
Aline.split(':')[0]
Bline.split(':')[5]
Cline
Duser
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong field indexes for username or home directory.
Not filtering lines correctly.