etgid bit always unset when changing file permissions - a strange and anoying bug

hello and good evening dear OpenSuse-friends

i run opensuse on the client and opensuse on the server - but believe me i soon go crazy.


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!? Can anybody explain why the chmod works for he buddy!?

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!?

Do you need more information 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
Dilbertone

Well just a guess but it looks to me that Filezilla does not support the SETGID-bit.

On 2012-01-26 20:36, dilbertone wrote:

> 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!?

It is unclear what you do. Trying to change permissions using what program,
and where, your local machine, or a remote machine, and then what protocol
is that software using?


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

hello googlethorp and robin

thx for the answers–…

some explanations - i have a root server that is administered by a friend
he sets up like so -

SETGID-Bit is set to on

i do some work - eg install a drupal or joomla
and then do some updates or exra installation of modules - and here the setgit-bit comes into play.
it should preserve that there no wwwrun user is being created. accordiing to my understanding]

example
if there was - during some installation of some extension in a joomal for example a wwwrun-user is being created the installation often stops and the extension
was not installed propperly
is not ready to use or something other weird things happen.

well for this we use the setgit-bit - to avoid several “accidents”

**
but now the weird - buggy thing comes into play. **

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!

a buddy anwerd that question like so:
linux - setgid bit always unset when changing file permissions - Super User



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.

well this could be a solution… could nt it?

again my problem is: everytime i touch the permissione -/ that means everytime i change something in the permissions on the remote server - i get lost (or let me say unset) the setgit -bit.

hmmm well as googleThorp said filezilla doe not supppport setgit-bitl. that i know allready . but the question is: if this is the case - do i get loose the setgit bit every time i do a operation with filezilla. - is this neccesarily the way iit is - and the case every time i touch the files-permisson with filezilla.

well if so - the i have to throw the fielzilla out of the window- or at least out of my linux machine…

then i have to use some other appropiate programme or way to do my work

what do you think ? i am eageriy waitin on your answer - since this is a big big issue to me.

many greetings

If Filezilla does not meet you needs use another FTP client that does. There are lots.
Perhaps request a fix from Filezilla people.
This does not appear to me to be a problem with the OS but a problem with Filezilla.

thx for the reply

well i need a SFT-client that offers Advanced SSH features.

filezilla does not - winSCP does not run on linux - but wait it does: i heard about a plugin

since FileZilla allows SFTP as well it is not too bad. But you cannot set the setgit-bit and that is annoying! I need to have advanced tools a friend told me; Alternatively you can give FAR File Manager with WinSCP-Plugin a try. what is the FAR-file-manager - i never ever heard about it.

well - and what about cyberduck; it says that we can accessing SFTP servers with all the bells and whistles.

it offers Interoperability: well does that mean that we can Read settings from the existing OpenSSH configuration options including Host aliases, public key authentication preferences and default login user. can we open a Integrated Terminal.app to open the current working directory in a shell. Works with PuTTY private keys.

googlethorp what do you think!?

I’d avoid running anything in Wine but you simply need to find one that you like. No reason not to try several. And there is always the command line FTP :slight_smile: