LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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, 10:30 PM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
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, 10:44 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,358

Rep: Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990Reputation: 1990
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 10:46 PM.
 
Old 11-16-2011, 12:56 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,258

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
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


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


All times are GMT -5. The time now is 03:07 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration