Lab Questions: You will need root access to answer these questions, so use your
ID: 3601360 • Letter: L
Question
Lab Questions:
You will need root access to answer these questions, so use your virtual machines.
1- What are some of the issues with su that sudo attempts to solve?
2- Name one file owned by each of the following users: daemon, bin, sys Look at two or more virtual machines.
3- Can the users listed in the previous question login? How did you determine this?
4- What is the purpose of the three accounts listed in the previous two questions?
5- Who are the members of the wheel group in your CentOS virtual machine?
6- Find a file with the setuid bit set. Say what the file is and why it needs setuid.
7- Give a command to open a root shell if you are logged in as a normal user (assume the user is allowed to do this).
Explanation / Answer
1) sudo enables a user to run a particular command with superuser or other user's privileges.
On the other hand su enables a user to log in as a superuser and execute commands with superuser privileges henceforth.
Once the sudo command completes execution the user privileges are restored to the original level. This is not the case with su.
2) Cannot answer without access to the particular vm
3) Whether a user can login or not can be determined from the /etc/passwd file. If the password value is set to * or ! , the user cannot log in using a password.
If the default shell is set to /bin/false then the user cannot login to a shell.
4) Daemon account is used to run long running proceesses as background tasks.
bin is used to run system level executables.
sys is used to run os tasks.
5) Cannot answer without access to the particular vm
6) When a user other than the owner executes an executable file with setuid bit turned on, the process will run with user permissions set upon it by its OWNER and not the actual user. This allows the executable too carry out certain privileged actions which it could not have done otherwise.
7) You can use su to open the root shell. It will prompt for the superusser password.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.