Skip to content

Instantly share code, notes, and snippets.

@joram77
Last active November 9, 2022 22:28
Show Gist options
  • Save joram77/e8ffe2d51c4a5691cbf35494ea374893 to your computer and use it in GitHub Desktop.
Save joram77/e8ffe2d51c4a5691cbf35494ea374893 to your computer and use it in GitHub Desktop.
Unable to write mount remote disk with SSHFS: permission denied writing files/folders on mapped drive
Problem: cannot write to mounted folder via SSHFS , permission denied
Solution: use the right switches to map the remote user AND explicitly state identity file
sshfs -o allow_other,defer_permissions,IdentityFile=~/.ssh/id_rsa_mycompany [email protected]:/ ~/example_local_mount_point/
The file system may not always do the right thing itself though--for example, if the file system retrieves file information from another computer and reports user/group IDs as is, the kernel will not see any alien IDs as belonging to the user that mounted the volume. (This can happen if user ID translation is not enabled or sometimes doesn't work with sshfs.) The
The defer_permissions (formerly defer_auth) option is useful in such cases. It causes osxfuse to assume that all accesses are allowed--it will forward all operations to the file system, and it is up to somebody else to eventually allow or deny the operations. In the case of sshfs, it would be the SFTP server eventually making the decision about what to allow or disallow.
https://github.com/osxfuse/osxfuse/wiki/Mount-options
@unlocomqx
Copy link

unlocomqx commented Nov 9, 2022

-o allow_other,defer_permissions solved my problem

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment