Re: set umask for sftp connection

From: Per Hedeland (per_at_hedeland.org)
Date: 05/29/04

  • Next message: Mike: "Re: Putty X Clients"
    Date: Fri, 28 May 2004 23:45:41 +0000 (UTC)
    
    

    In article <c94g16$hfu$1@gate.dodgy.net.au> dtucker@dodgy.net.au (Darren
    Tucker) writes:
    >In article <5e909902.0405270139.73a7b6b0@posting.google.com>,
    >Pat Buerki <bpm13@gmx.net> wrote:
    >>bpm13@gmx.net (Pat Buerki) wrote in message
    >news:<5e909902.0405250654.4fb8711@posting.google.com>...
    >>> However, when copying files, these have a
    >>> permission of 644, which imho is not set by the unix system.
    >>
    >>ssh takes the umask of the parent sshd process, which would normally
    >>be inherited from init, unless restarted by hand.
    >
    >OpenSSH 3.7x and up will pick up the user's umask from /etc/default/login
    >on platforms that have it (like Solaris).

    Maybe it should also be pointed out that files being created with 644 in
    no way rules out that the umask actually *is* 002 (as apparently desired
    by the OP). I believe sftp will (try to) preserve the permissions of the
    source file - if it is 644, it neither will nor should become 664 at the
    destination just because the umask there is 002. (Arguably if sftp tries
    to preserve permissions, it should actively "disobey" the umask by chmod
    after creation - but even if it doesn't, umask can of course only ever
    *clear* bits.)

    --Per Hedeland
    per@hedeland.org


  • Next message: Mike: "Re: Putty X Clients"

    Relevant Pages

    • Re: default permissions when scping files
      ... >> username take on specific permissions, or barring that, ... I read it to mean that the umask does not affect the execute bit of files ... as the source file has. ...
      (comp.unix.shell)
    • Re: default permissions when scping files
      ... >> To calculate permissions which will result from specific UMASK ... > mode for the target file, as the source file has. ...
      (comp.unix.shell)
    • Re: sftp file transfer log
      ... openssh does not support sftp transfer logging. ... > Do you know how to turn on SFTP file transfer log? ... environment to the sftp-server subsystem. ... log("setting file creation mode to 0666 and umask to %o", ...
      (comp.security.ssh)
    • SUMMARY: SFTP and umask and enhanced security (only using shadow passwords)
      ... After moving to use shadow passwords, our sftp users now end up creating ... In /etc/profile the umask is set to 022. ... Enhanced security changes the default umask to 077 ...
      (Tru64-UNIX-Managers)
    • Re: SFTP and umask
      ... Did you get any solution on changing the umask for files you are ... Drew Boone wrote: ... The umask for sftp on my server appears to be 066, ... to uninstall and compile OpenSSH myself. ...
      (SSH)