Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need step 1-5 and 1-3 1-3 00 Sprint 1:01 PM 50% writeup for Sticky Bit SETUID an

ID: 670810 • Letter: N

Question

Need step 1-5 and 1-3
1-3
00 Sprint 1:01 PM 50% writeup for Sticky Bit SETUID and SETGID Permissions STEP 1: In your own words, explain what is SETUI and SETGID P STEP2: What will happen if you use SETUID and SETGID Permission? STEP 3: Using chmod give 3 examples of SETUID and SETGID. Be able to teach someone else what your examples means. ermission. Example: chmod u+s. STEP 4: What is a sticky bit? STEP5: Give three exam to teach someone else what your examples means. ple of a sticky bit. Be able Example: chmod 4755 myprogl Defining Special Permissions 1. Explain the purpose of the set user ID (SUID) permissions, outlining how it temporarily makes the person accessing a file the owner of that file. Remind students that the permission has no impact when set on a directory. Point out that the SUID is only applied to binary executables. 2. Explain the purpose of the set group ID (SGID) permission, explaining how it allows a user to temporarily become a member of the owner group associated with a file or directory. Provide examples of when the SGID typically set. permission is 3. Explain the purpose of the sticky bit and how it allows users to add files to a directory, but not delete all files in the directory as would the write command. Setting Special Permissions

Explanation / Answer

Step1: SETUID and SETGID permission

They are access rights flags that allow users to run an executable with the permissions of the executable's owner or group respectively and to change behaviour in directories.

SETUID: Set-user identification. It is a special permission given to a user to run others file/directory.

SETGID: set-group identification. It is a special permission given to a group to run others file/directory.

Step2: Result of setting SETUID and SETGID : When the SETUID and SETGID are permissions are set, any user who runs that executable file assumes the user ID of the owner (or group) of the executable file.

Step 3: Examples of SETUID :

# chmod 4755 suidexample.sh

Then permissions on suidexample.sh now look like the following:

-rwsr-xr-x   1 trhodes trhodes    63 Aug 29 06:36 suidexample.sh

The end result would be that using ls -l to see these permissions would show something like this:

# ls -l /bin/ls

-r-sr-xr-x 1 root wheel 25312 May 1 2009 /bin/ls

Example of SETGID :

To set the setgid permission on a file, provide chmod(1) with a leading two (2):

# chmod 2755 sgidexample.sh

In the following listing, notice that the s is now in the field designated for the group permission settings:

-rwxr-sr-x   1 trhodes trhodes    44 Aug 31 01:49 sgidexample.sh

step4: Sticky bit:

It is a permission bit that protects the files within a directory. If the directory has the sticky bit set, a file can be deleted only by the owner of the file, the owner of the directory, or by root. This special permission prevents a user from deleting other users' files from public directories

Step 5: Examples of sticky bit:

# chmod 1777 /tmp

The sticky bit permission will display as a t at the very end of the permission set

drwxrwxrwt 10 root wheel         512 Aug 31 01:49 tmp

# mkdir allAccess

# chmod 777 allAccess/

# chmod +t allAccess/

drwxrwxrwt 2 himanshu himanshu 4096 Oct 24 16:19 allAccess/

If a ‘guest’ tries to rename the file ‘user_file_1, here is what happens

$ mv /home/himanshu/allAccess/user_file_1 /home/himanshu/allAccess/user_file_0

mv: cannot move `/home/himanshu/allAccess/user_file_1'`/home/himanshu/allAccess/user_file_0': Operation not permitted

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote