Topic "file permission mask setting"

Author Message
Halfgaar

Guest


Hi,

I was wondering if there is a way to have the filepermissions of every file copied set to 0770 (for example). I'm looking for a server-side setting. The .bash_profile doesn't seem to be read by winSCP, so I can't use "umask 0770", or can I somehow?

Thanks in advance,

Halfgaar
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
You may specify some script, which does the settings and finally launches shell, instead of actual shell on Shell tab of login dialog. But in fact, AFAIK, SCP protocol ignores umask Sad. Why don't you use "set permisssions" setting on copy confirmation dialog?
_________________
Martin Prikryl
Halfgaar

Guest


prikryl wrote:
Why don't you use "set permisssions" setting on copy confirmation dialog?


Because the server is accessible through samba as well, as another user but in the same group. And on top of that, the fileserver is going to be syncrhonised with another tool called unison, a tool like rsync, but is supports two way mirroring. I need the garantee that every file has the correct permissions, or else strange things will happen Smile
Halfgaar

Guest


Hi,

I've found a workaround, so my problem is fixed Smile
Jay

Guest


Halfgaar wrote:
Hi,

I've found a workaround, so my problem is fixed Smile


Could you let the rest of us know what your workaround is? I'm having the same problem with the program ignoring the umask setting.

Yes, with the newer versions of WinSCP you can change permissions on the transfer confirmation dialog, but that requires the user to take an action. The whole point of the umask is that, unless the user takes an action, you get the right permissions.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
First of all: I was wrong stating that SCP protocol ignores umask, it does not.
Quote from comp.security.ssh:
Quote:
If you read the bash man page section entitled "INVOCATION," you will find
that bash only sources the login files (.profile, .bash_profile, etc.) on
interactive logins, regardless of whether the shell is invoked as a login
shell or not (which it is by sshd). scp runs ssh in a subprocess to start
another copy of scp as a remote command, which does not allocate a tty, so
this counts as a non-interactive login.

Put the umask command in .bashrc instead.
Halfgaar

Guest


Firstly, I'm sorry for my late reply.

Secondly, the thing with bashrc, impossible. I've tried everything and everything on the google groups. (Win)SCP seems to be ignoring it. I also read something (I believe the same dude which wrote the piece of text prikryl quoted said so) about someone having problems with getting it to work with bash. He recommendes CSH instead. But I'm not going to switch shell...

Then, my workaround: The fileserver is also accessible with samba, for local users. Samba can set permissions and owners perfectly. So what I did, was mount the samba share through loopback and gave the remote-access user that mountpoint as home dir. The downside is, that setting permissions is disabled completely like this.

If anything is unclear, let me know Smile

Halfgaar
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License