2

good evening dear Serverfolks!

i am a newbi so do not bear with me! I run a linux sever that is administered by a friend of me. He prepares the chown and permissins - with the setgit-bit to on.

Well the trouble is that i get lost the setgitbit every time when i touch the permissions with FileZilla. That is the terrible issue! Note - at the moment i do not have a access to the server wit WinSCP - winscp can set the Setgit. Filezilla cannot do this at all!

on openSuse Linux server My Setup: OpenSuse 11.4 on the local machine! Linux- Server

FileZilla Client
----------------
Version:          3.3.4.1
Build information:
  Compiled for:   i686-pc-linux-gnu
  Compiled on:    i686-pc-linux-gnu
  Build date:     2011-02-23
  Compiled with:  gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
  Compiler flags: -fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector 
- funwind-tables -fasynchronous-unwind-tables -g -fstack-protector -Wall -g -fexceptions

Linked against:
  wxWidgets:      2.8.11
  GnuTLS:         2.8.6

Operating system:
  Name:           Linux 2.6.37.6-0.7-default i686
  Version:        2.6

Well folks i go crazy - sure thing:

I run a linux-root-server that is administered by a friend of mine. i controll the SFTP session - with filezilla (see all i mentione above) in order to do installations and maintenance of some drupal-installations (and besides them some joomla-sites) Note: in the future i want to install Drush - in order to get rid all that annoying bugs.

I am using directories with setgid bit set. I want to change the permissions of newly created directories to give write permission to the group (by default they have not). For this I right-click on the directory and change the permissions from the Properties dialog. When I change the permissions of a directory that way, the setgid bit gets removed. In fact, there is no way to set the setgid bit, it just always gets turned off, whatever operation one does on permissions.I heard that a buddy found a workaround by creating a custom command that executes chmod -R g+w "!" and applies on directories. This works fine. he said. Well what should i do!?

Well i go almost crazy and throw the computer out of the window (well notabene - of the 14 th floor) this is sure thing no good idea but i need to have a solution. waht should i do here.

Note: with FileZilla you cannot (!!!!!) set the SETGID-Bit again - no way here - no chance. But with winscp (see below the link ). And you can imagine with Drush you can do it too! What sould i do - can you advice something for me! btw: see winscp with its ability to control the SETGID bit more than the FileZilla can do!! Well what can cause the issue - where is it rooted. Why do i loose the SETGID-Bit every time!

It is possible that our SFTP server does not support the setgit bit and silently ignores the request to set it.

What is the issue - can it be the SFTP.-SERVER!?

As i am a bloddy newbi i probably do not provide you with all the infos you need!? Do you need more information or more input!? Should i do more investigations on the troubles and the environment. just let me know - i do everything to get the troubles rid!

look forward to hear from you

Greetings zero

Update: hi Zoredache and malcompdx thx for the answers. Well Malcompdx - did you recognice a error in the server-subsytem!? Did you find the issue is rooted in this. Well the trouble is that i get lost the setgitbit every time when i touch the permissions! That is the terrible issue! And if i got you right - then the fix is in your answer Malcompdx - many thanks . also to you ZoreDache

btw see the thread that describes the same issue - that happens also in winscp http://winscp.net/forum/viewtopic.php?t=8306

2 Answers 2

2

It's not actually filezilla, it's the umask that sftp uses.

Change

Subsystem sftp /usr/libexec/openssh/sftp-server

to Subsystem sftp /bin/sh -c 'umask 0002; /usr/libexec/openssh/sftp-server'

in the server's sshd_config file, and restart sshd, and you should then find that sgid bit is preserved if the parent directory has it set.

9
  • If it was the umask, then why would it work in winscp?
    – Zoredache
    Jan 26, 2012 at 19:46
  • Because scp != sftp. They function entirely differently - scp respects the umask of the user that it is running as, but sftp doesn't.
    – malcolmpdx
    Jan 26, 2012 at 19:56
  • hi Zoredache and malcompdx thx for the answers. Well Malcompdx - did you recognice a error in the server-subsytem!? Did you find the issue is rooted in this. Well the trouble is that i get lost the setgitbit every time when i touch the permissions! That is the terrible issue! And if i got you right - then the fix is in your answer Malcompdx - many thanks . also to you ZoreDache
    – zero
    Jan 26, 2012 at 20:11
  • 'UPDATE to explain it agian I run a linux sever that is administered by a friend of me. He prepares the chown and permissins - with the setgit-bit to on. Well the trouble is that i get lost the setgitbit every time when i touch the permissions with FileZilla. That is the terrible issue! Note - at the moment i do not have a access to the server wit WinSCP - winscp can set the Setgit. Filezilla cannot do this at all!
    – zero
    Jan 26, 2012 at 20:18
  • Malcompdx should i change the Subsystem sftp /usr/libexec/openssh/sftp-server to Subsystem sftp /bin/sh -c 'umask 0002; /usr/libexec/openssh/sftp-server' in the server's sshd_config file, and restart sshd, and then it works!?! Should i then find that sgid bit is preserved if the parent directory has it set. Well Malcompdx i try it out and come back and report allthe findings
    – zero
    Jan 26, 2012 at 20:19
1

The application is almost certainly sending the permission change to the server in octal like 0775.

Simply checking/unchecking boxes is not going to do what you want. If you want to set the permissions, provide the options in octal.

To set the permission so of a directory to drwxrwsr-x, you should send 2775 into the numeric value box.

filezilla permissions

2
  • hi ZoreDache thx for the answer
    – zero
    Jan 26, 2012 at 20:12
  • zoredache - my experience (with the above mentioned Filezilla ) is the following EVERYTIME i touch the file-permissions i loose the setgit bit. 'I can do whatever i want!? I get lost it!
    – zero
    Jan 26, 2012 at 21:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .