Set-Uid Lab

Satisfactory Essays
1. Figure out why "passwd", "chsh", and "su" commands need to be Set-UID programs. What will happen if they are not? If you are not familiar with these programs, you should first learn what they can do. Their source codes are in /usr/src/commands/simple directory. because if they were not, any user would be able to change passwords, or change things dealing with the os, and they would be just as powerful as the root user. with the those commands being setuid programs, that ensures that roots are the only ones with high access privileges and that normal users are restricted from certain things. 2. Read the OS source codes of Minix, and figure out how SET-UID is implemented in the system. You should answer the following questions,…show more content…
b. Still use the same program, but replace system() with execve(). Run the program using a regular user account in both Minix and Linux. Describe and explain your observation. If the observation is different from that of the previous program, you need to explain what causes such a difference and which call is more secure. minix: i am unable as a normal user, to access the file. Execv is definitely more secure, as i was not even able to read the file linux: same as minix answer 6. To be more secure, SET-UID programs usually call setuid() system call to permanently reliquish their root privileges. However, sometimes, this is not enough. Comple the following program in Linux, and make the program a set-root-uid program. Run it in a normal user account and describe what you have observed. Will the file/etc/zzz be overwritten? Please explain your observation minix: the file was not overwritten, since the root privileges had been relinquished linux: same results as
Get Access