Re: set umask for sftp connection

From: Pat Buerki (bpm13_at_gmx.net)
Date: 05/27/04

  • Next message: Darren Tucker: "Re: set umask for sftp connection"
    Date: 27 May 2004 02:39:15 -0700
    
    

    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.
    So probably since sshd runs as root it's taking the default umask from
    root, and not the user in the session.

    > Therefore, it must be the sftp program, which sets this mask. Although
    > there should be a possibility to change file permissions in WSFtp
    > (according to the manual), this doesn't work. I neither don't want to
    > change permissions of all my files after uploading; this would be to
    > much useless work.

    Some clients give the option to set default permissions for uploads,
    or to preserve permissions for uploaded files from the client; most of
    them don't.

    > Question: Is there a possibility to override the umask of WSFtp by the
    > solaris system? Maybe in ssh or sftp config file? If this is possible,
    > how exactly is it done?
    > I have scrutinized all manuals of WSftp pro (they don't seem to be
    > satisfying) and also the Google Groups. None of the hints I got are
    > working.

    As stated above, the client takes the umask from the ssh daemon. So
    just insert the command 'umask 002' (or the desired umaks value) into
    start_service() routine in /etc/init.d/opensshd
    At least this works. However, I'm not sure if this solution has any
    severe disadvantages. If you know more, please let me know.


  • Next message: Darren Tucker: "Re: set umask for sftp connection"

    Relevant Pages

    • Re: Files not inheriting folder permissions?
      ... No, it doesn't, that's how file permissions work with any unix system. ... File permissions for users are set with their 'umask'. ... make the proper system calls to set permissions, ...
      (linux.redhat)
    • Re: umask?
      ... setgid permissions used on your files and directories. ... the default umask value set on your system to 027, ... The shell does simple maths to determine what permissions are used on ... On a directory the maximum permissions will be drwxrwxrwx. ...
      (Fedora)
    • Re: [patch 12/13] ACL umask handling workaround in nfs client
      ... >> the umask locally, and sends the effective permissions to the server. ... >> only the default ACL determines the file's effective permissions. ...
      (Linux-Kernel)
    • 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: File Permissions problem : Cry for HELP
      ... is something wrnog with the server cause when i upload the same files from ... >> i have a problem with file permissions, each new file i need to create i ... >> Internal Server Error ... > You need to change the umask used when you are saving web files. ...
      (Fedora)