Re: openssh: Default umask for SFTP?



On Tue, Oct 10, 2006 at 11:43:27AM -0500, Mark Holden wrote:
The issue is that when I SFTP a file onto the server, the default umask
used seems to be 077, given that files are created with mode 600 and
directories with mode 700.

This doesn't match my experience.

pegasus:~$ touch foo
pegasus:~$ ls -l foo
-rw-r--r-- 1 greg greg 0 Oct 11 08:37 foo

pegasus:~$ sftp greg@griffon
Connecting to griffon...
Enter passphrase for key '/home/greg/.ssh/id_rsa':
sftp> cd /tmp
sftp> put foo
Uploading foo to /tmp/foo
foo 100% 0 0.0KB/s 00:00
sftp> ls -l foo
-rw-r--r-- 0 1000 1000 0 Oct 11 08:37 foo

Perhaps your sshd daemon is being started with a umask of 077, which is
then passed down to the sftp-server child. Examine your start scripts,
and see whether putting "umask 022" (or whatever you wanted) in the
sshd start script helps.



Relevant Pages

  • Re: `our declaration causing problems with `strict pragma across files
    ... > I have a set of executable scripts, all written in Perl. ... > to use the `strict' pragma: ... foo: ...
    (comp.lang.perl.misc)
  • Re: ls -d does not do what I want/expect
    ... Barry Margolin wrote: ... tree, but I suppose -d might be useful in scripts. ... shows all non-hidden files matching the value of `$FOO' starting from ...
    (comp.unix.shell)
  • Re: Parser, again!
    ... But my scripts tend to be what, ... where FOO was defined elsewhere and macro-expanded ... using /many/ levels of macros before being compiled. ... expect "customer support" if something like that is needed though:D. ...
    (comp.arch.embedded)
  • Re: Case Sensitive, Multiline Comments
    ... i found case sensitivity very useful ... and dict type should be case sensitive ... It's necessary when i write short scripts and i use one letter ... class Foo: ...
    (comp.lang.python)
  • Split a single function in many mfiles
    ... I would like to split the code of a function in many files, beside the main file, others look like scripts like the following example: ... function foo() ... % do task #3 using variables defined in bar ... can I expect is exactly like fooandbar()? ...
    (comp.soft-sys.matlab)