LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-15-2011, 09:30 PM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
How to set to this permission


I have a file , this file must be in the following permission if we want to use it.

-rws--s--x

I tried to use chmod +s file_name but not work , can advise how to change the mode ? besides , what is "s" permission means ?

Thanks.
 
Old 11-15-2011, 09:44 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
http://www.comptechdoc.org/os/linux/..._ugfilesp.html

Quote:
The file permissions bits include an execute permission bit for file owner, group and other. When the execute bit for the owner is set to "s" the set user ID bit is set. This causes any persons or processes that run the file to have access to system resources as though they are the owner of the file. When the execute bit for the group is set to "s", the set group ID bit is set and the user running the program is given access based on access permission for the group the file belongs to. The following command:

chmod +s myfile

sets the user ID bit on the file "myfile". The command:

chmod g+s myfile

sets the group ID bit on the file "myfile".



Hopefully this is of some use, I've never used the s flag for permissions, so I don't have any personal experience with it.


From what I can tell, this would give you the permissions you seek:
Code:
chmod 711 file
chmod u+s file
chmod g+s file
There's probably a way to do it in fewer commands, but like I said I have no experience with the "s" permission flag.

Last edited by suicidaleggroll; 11-15-2011 at 09:46 PM.
 
Old 11-15-2011, 11:56 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Code:
chmod ug+s filename
It's very unusual to have setuid & setgid on the same file. Are you sure that's right?

To set all perms as above
Code:
chmod u=rwxs,g=sx,o=x filename
That's a unique combo; never seen it before...
 
  


Reply



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
Can't set PWD despite having sudo permission set. spoovy Linux - Newbie 7 03-04-2010 02:07 AM
Samba MODIFY permission needs 'x' permission set in Linux? jlinkels Linux - Software 6 11-13-2009 09:30 AM
Help me to set Permission linux.queries.help Linux - Security 1 04-09-2009 06:36 AM
How to Set nobody Permission jamesnkk Linux - Newbie 13 08-11-2008 11:34 PM
how to set quota, a/c and permission gogo Linux - General 1 10-09-2001 01:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:52 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