UID/GID with sshfs of Linux FUSE

8,313

Try chucking in the two following options

-o idmap=user,uid=<YOUR UID>
Share:
8,313

Related videos on Youtube

porton
Author by

porton

Updated on September 18, 2022

Comments

  • porton
    porton almost 2 years
    mkdir ~/mnt/2letter
    echo PASSWORD | sshfs -o password_stdin www-data@localhost:/var/www/sites/2letter ~/mnt/2letter -o sshfs_sync,cache=no,password_stdin

    After this:

    $ ls -ld ~/mnt/2letter/
    drwxr-xr-x 1 www-data www-data 4096 Jan 28 21:29 /home/porton/mnt/2letter/

    I need to access /home/porton/mnt/2letter/ under my UID (porton) not as www-data, because I am not allowed by file system permissions to modify www-data owner files, but need to edit them.

    Moreover it seems to have been working with the correct UID with older versions of Linux. Why doesn't it work now?

  • porton
    porton over 11 years
    Yes, it works, I need also to specify gid=XXX, but why does it works only with numeric IDs
  • tink
    tink over 11 years
    You will have to ask the author(s) of sshfs that question :)
  • splaisan
    splaisan almost 5 years
    in order to discover the numbers behind your uid and gid, you can use the id command. With these numbers you can specifi exactly who is mounting and get the correct rights after that (id -u gives you your uid number and id -g your group (note: @Jeff why did you delete my answer, I consider is was very relevant as many users do not know how to get their id details - is this a place for experts only or for learning things !?)
  • tink
    tink almost 5 years
    @splaisan - are you sure you're talking to the right people? There's no Jeff in this thread ...
  • splaisan
    splaisan almost 5 years
    Hi @tink. Yes i am, and believe me I am not looking for a fight here, I was just very surprised that my previous answer was simply deleted by a Jeff Schaller who I stil see but apparently not you, here a screenshot