Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Halfgaar

Re: file permission mask setting (fixed) + workaround

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 :)

Halfgaar
martin

Re: file permission mask setting (fixed)

First of all: I was wrong stating that SCP protocol ignores umask, it does not.
Quote from comp.security.ssh:
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.
Jay

Re: file permission mask setting (fixed)

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.
Halfgaar

Re: file permission mask setting (fixed)

Hi,

I've found a workaround, so my problem is fixed :)
Halfgaar

Re: file permission mask setting

martin 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 synchronised with another tool called unison, a tool like rsync, but is supports two way mirroring. I need the guarantee that every file has the correct permissions, or else strange things will happen :)
martin

Re: file permission mask setting

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 :-(. Why don't you use "Set permissions" setting on copy confirmation dialog?
Halfgaar

File permission mask setting

Hi,

I was wondering if there is a way to have the file permissions 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