Change permissions and SFTP

Advertisement

scottrell
Joined:
Posts:
1
Location:
Minneapolis

Change permissions and SFTP

We have a problem when using the SFTP (transfer) protocol and creating/changing permissions on directories. The base permissions on the directories are (octal) 2775. When a new subdirectory is created, it cannot set the "Set GID" permission on the new directory, although the owner:group is set correctly.

Creating a new directory within this subdirectory therefore sets the ownership as owner:owner, which is not what we want.

When creating these directories, I have used the "More >>" button to test all kinds of variations to enable the Set GID bit, but it will not do it. I have also tried several combinations on the Properties of the new folder, and cannot set the Set GID bit.

From the command line (within the SFTP session, not a shell), the command "chmod 2775 testfolder" results in the following error:
Current SFTP-3 session does not support command you request. Separate shell session may be opened to process the command. Do you want to open separate shell session?

The shell session is able to run the command and set the permissions properly.

Likewise, when using the SCP (transfer) protocol, everything works properly from the beginning--new directories are created with octal 2775. (the session protocol in all instances is SSH-2)

Yet, it appears we should be able to change the permissions based on the "Capabilities" of the SFTP transfer protocol.

What are we missing to get this to function as expected with SFTP?

Thank you
-sc

WinSCP v4.0.4 build 346
--------------------------
Session protocol = SSH-2
SSH implementation = OpenSSH_3.4p1
Encryption algorithm = aes
Compression = No
File transfer protocol = SFTP-3
Can change permissions = Yes
Can change owner/group = No
Can execute arbitrary command = No
Can create symlink/hardlink = Yes/No
Can lookup user groups = No
Can duplicate remote files = No
Can check available space = No
Can calculate file checksum = No
Native text (ASCII) mode transfers = No
------------------------------------------------------------
Additional information
The server does not support any SFTP extension.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,542
Location:
Prague, Czechia

Re: Change permissions and SFTP

scottrell wrote:

We have a problem when using the SFTP (transfer) protocol and creating/changing permissions on directories. The base permissions on the directories are (octal) 2775. When a new subdirectory is created, it cannot set the "Set GID" permission on the new directory, although the owner:group is set correctly.
This is typically problem of the SFTP server. I believe that WinSCP issues the command properly.

From the command line (within the SFTP session, not a shell), the command "chmod 2775 testfolder" results in the following error:
Current SFTP-3 session does not support command you request. Separate shell session may be opened to process the command. Do you want to open separate shell session?
Is the command issued exactly as you've posted? Because "chmod" command should never result in that error. What version of WinSCP are you using?
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum