Cybersecurity Ops with bash - Chapter 17 Solutions

Below are selected solutions for the Chapter 17 workshop questions from Cybersecurity Ops with bash. Note - These are just examples, many possible solutions exist.


Question 1


Write a Linux command to create user mwilson with the password magic.


Answer


Use the useradd command to add a new user in the Linux environment. The -m option is also used to create a home directory for the user.


Next you can set the password for the new user using the passwd command. After entering the command you will be prompted to enter a new password.



Question 2


Write a Linux command to create the group marketing.


Answer


Use the groupadd command to add new groups in the Linux environment.



Question 4


Write a Windows command to create user frogers with the password neighborhood.


Answer


In Windows, the net command can be used to add new users.


Note that the example above illustrates running the command from Git Bash. If you run the command from the Windows command prompt you only need a single forward-slash before add (/add).


You can also use the net command to set the user's password.



Question 5


Write a Windows command that gives user tjones full permission to the file lyrics.txt.


Answer


In Windows the icacls command can be used to manage user permissions.


Note that the example above illustrates running the command from Git Bash. If you run the command from the Windows command prompt you only need a single forward-slash before grant (/grant).


0 views

© 2019 by Paul Troncone and Carl Albing