Results 1 to 9 of 9

Thread: mounting via sshfs, fuse, fstab ... want umask=002, get umask=022

  1. #1
    Join Date
    Mar 2010
    Beans
    3

    Angry mounting via sshfs, fuse, fstab ... want umask=002, get umask=022

    I successfully mount various remote directories via /etc/fstab using lines like ...

    sshfs#user@remote:/dir /local/mount/point fuse umask=002,allow_other,user,noauto 0 0

    The problem is that when I try to create new directories in my mounted directories, they have the wrong permissions - rwxr-xr-x (022), instead of rwxrwxr-x (002). To further clarify, they have the right permissions when I look at them in the local mount (002), but the wrong permissions when I ssh into the remote host and do a ls -l (022).

    Typing 'umask' at the prompt, both on the remote host and the local host yields '0002'. If I ssh into the remote host with the same account I'm using to mount, I can create a directory and it has the proper permissions.

    What the heck am I doing wrong? It's driving me insane!

  2. #2
    Join Date
    Mar 2010
    Beans
    3

    Re: mounting via sshfs, fuse, fstab ... want umask=002, get umask=022

    bump

  3. #3
    Join Date
    Mar 2009
    Beans
    24

    Re: mounting via sshfs, fuse, fstab ... want umask=002, get umask=022

    my best guess would be that you can't create a file 002 because you're trying to create a file you can't write.

    i don't know the exact details or the proper language, but when a new file is created, my understanding is it creates the file descriptors and links before it actually creates the file. the problem being that they would prevent the file from being created since you aren't allowing write access with 002 permissions.

  4. #4
    Join Date
    Aug 2009
    Beans
    5

    Re: mounting via sshfs, fuse, fstab ... want umask=002, get umask=022

    @zeefreak - umask is used to specify which flags you don't want set on new files...

    so a umask of 002 (or 0002) is like chmod'ing the new file to 775

    http://www.novell.com/coolsolutions/trench/16940.html


    @lonelytylenol - i'm trying to find a similar solution (I'm just creating temporary mounts over sshfs using the GUI) - i think something needs setting on the server (not the client like you have, though you might be right - i'm not to savvy on fstab)

    i just can't find where/what/how

  5. #5
    Join Date
    Aug 2009
    Beans
    5

    Re: mounting via sshfs, fuse, fstab ... want umask=002, get umask=022

    heh - post and solve...

    the answer seems to be setting the server's default umask where you're mounting to in /etc/profile

    http://ubuntudemon.wordpress.com/200...default-umask/

    i suppose the usual caveats apply about changing defaults and security blah

  6. #6
    Join Date
    Aug 2009
    Beans
    5

    Re: mounting via sshfs, fuse, fstab ... want umask=002, get umask=022

    ack - k, so that didn't work...

    then i found another place where umask is can (and apparently should) be set - /etc/login.defs :

    http://linuxmanpages.com/man5/login.defs.5.php

    this doesn't make a difference either...

    i think i'm going loopy - because i'm pretty sure this is working right on the setup at my office (unable to access from here atm).

  7. #7
    Join Date
    Jan 2009
    Location
    Denmark
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: mounting via sshfs, fuse, fstab ... want umask=002, get umask=022

    Why dont you set the umask value for the entire system or for spefific users.

    Code:
    umask
    Checks the current system umask value.
    Code:
    umask value
    defines a new value.

    example
    Code:
    umask 0033

  8. #8
    Join Date
    Mar 2010
    Beans
    3

    Re: mounting via sshfs, fuse, fstab ... want umask=002, get umask=022

    Quote Originally Posted by Drenriza View Post
    Why dont you set the umask value for the entire system or for spefific users.
    From my original post: "Typing 'umask' at the prompt, both on the remote host and the local host yields '0002'. If I ssh into the remote host with the same account I'm using to mount, I can create a directory and it has the proper permissions."

    The umask is already correctly set on local and remote hosts. The problem seems to be in how the mount is happening, but that's where I run out of ideas.

  9. #9

    How to configure permissions with SSH

    A new guide to configure better the client and the server:
    http://wiki.lapipaplena.org/index.ph..._SFTP_accesses

    (with special care with owners and permissions questions)
    Narcis Garcia

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •