LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-31-2007, 12:49 PM   #1
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Rep: Reputation: 31
Question Permissions how to: drwxrws--x


As you can see in the subject the permissions: drwxrws--x. I'm transferring files from one server to another. One of the directories has the permissions of drwxrws--x. When I transfer it to the other server I get: drwxrwx--x. I'm using rsync to do this. I would like to know what is that s and how would I set it using chmod if that is the case. Thanks
 
Old 05-31-2007, 01:09 PM   #2
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
s - Set user ID
Look at "Set User Identification Attribute" in the article link below.
http://www.comptechdoc.org/os/linux/..._ugfilesp.html

Last edited by Junior Hacker; 05-31-2007 at 01:13 PM.
 
Old 05-31-2007, 01:13 PM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
s in that position is set group ID

You can details of all the permissions by typing:
man chmod

chmod 2755 filename

Would set permissions to what you had before.

In your rsync are you using -p or -a?
 
Old 05-31-2007, 01:29 PM   #4
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
I'm using -a. Can I use both: -a and -p?

Last edited by cucolin@; 05-31-2007 at 01:33 PM.
 
Old 05-31-2007, 01:55 PM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
-a is the same as setting many individual flags including -p so you don't need to include -p if you're doing -a.

Just hadn't really run across the SGID in my prior rsyncs so was curious if you were using it. Probably doesn't transfer SUID either for security reasons.
 
Old 05-31-2007, 02:27 PM   #6
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
Now when I try to change it at the destination server using chmod 2755 filename I get:

chmod: changing permissions of `filename': Permission denied

In this hosting server I cannot use sudo or su. So I cannot change it.
 
Old 05-31-2007, 02:50 PM   #7
cucolin@
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu, CentOS, RedHat
Posts: 416

Original Poster
Rep: Reputation: 31
I did it this way:

chmod g-x dirname
then:
chmod g+s dirname
and it works but I get:
drwxrwS--x instead of lowercase 's' drwxrws--x. Is there a difference?
 
Old 05-31-2007, 03:24 PM   #8
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You shouldn't have removed the x. The SGID is in ADDITION to the other permissions.

rwxrwsrwx = Group has read, write and execute AND SGID is set.

rwxrwSrwx = Group has only read and write (NO execute) AND SGID is set.

The upper case S is just to distinguish it from having the execute bit set.

By the way - earlier I mistakenly said "chmod 2755" - it should have been "chmod 2775".

You should be able to add the execute bit back with "chmod g+x" - if that doesn't make it go to lower case "s" but rather to "x" just do your "chmod g+s" afterwards.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permissions please help me! seiferkai Linux - Hardware 1 08-12-2006 12:59 AM
Permissions itz2000 Linux - Newbie 7 03-07-2006 02:00 AM
file permissions OK, but command permissions? stabu Linux - General 2 10-05-2005 12:00 PM
permission ... permissions .... permissions alaios Linux - General 1 05-31-2005 04:16 AM
getting a directory's permissions and creating a new one with the same permissions newbie1000101 Programming 1 04-10-2004 12:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:14 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
Open Source Consulting | Domain Registration