LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-29-2016, 01:26 AM   #1
techie_san778
Member
 
Registered: Jul 2011
Posts: 90

Rep: Reputation: Disabled
Exclamation A query regarding sticky bit


Hello Friends,

To add a stick bit to the permissions of a directory, we have to do
$chmod g+t Folder01.
I want to know what is the effect of using t with u and o, i.e. to say,
$chmod u+t Folder01 or $chmod o+t Folder01 ?
I saw that the commands run without any error. But i want to know if there is some other effect than simply protecting the user's files in the directory from deletion from the members of the "Group" and "Others" ?

Regards

Last edited by techie_san778; 05-29-2016 at 02:50 AM.
 
Old 05-29-2016, 03:35 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,258
Blog Entries: 3

Rep: Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713
The +t should have no effect on u and g, but a +s should have an effect. The manual page for "chmod" has a little information about SetGID, SetUID, and the sticky bit. You can watch it with "stat"

Code:
mkdir Folder01

chmod u-s,g-s,o+t Folder01;
stat -c"%a" Folder01;

chmod u-s,g+s,o+t Folder01;
stat -c"%a" Folder01;

chmod u+s,g+s,o+t Folder01;
stat -c"%a" Folder01;
I'm not sure that there is any effect of setting the SetUID bit on a directory, but on a file, especially an executable, you don't want it. It would allow other users to run the file as the owner of the file.

The sticky bit o=t should just protect the files from deletion by others.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sticky-bit fakie_flip Linux - Software 3 11-19-2012 05:04 PM
Sticky situation bcos of sticky bit Voyager7 Linux - Newbie 4 02-28-2011 11:29 PM
About Sticky bit... masudur_iiu General 4 09-13-2006 10:23 AM
Sticky Bit tarballed Linux - General 4 07-03-2002 03:54 PM
sticky bit motiram Linux - General 1 08-01-2001 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration