Mount with SSHFS with correct owner and group

Authmane Terki
1 min readNov 25, 2019

--

I had today a strange error. If I mounted a remote folder with SSHFS, the owner was wrong:

$ whoami
authmane512
$ la /media/mycloud/
total 152K
drwxr-xr-x 1 <not authmane512> <not authmane512> 4.0K Nov 21 14:43 ./

To solve this problem, I use the parameters -o uid= and -o gid= .

To know what is my user ID and my group ID, I run:

$ id
uid=1000(authmane512) gid=1000(authmane512) groups=1000(authmane512),24(cdrom),25(floppy),27(sudo)

Then:

$ sshfs -o reconnect,uid=1000,gid=1000  mycloud:/home/myfiles /media/mycloud
$ la /media/mycloud/
total 152K
drwxr-xr-x 1 authmane512 authmane512 4.0K Nov 21 14:43 ./

--

--