sshfs-win
sshfs-win copied to clipboard
Access denied when trying to read or write files
Presumably this is related to the sshfs
--allow-other
argument. How do I add this argument through net use or map network drive?
I have a similar problem. I just have read-only access when using sshfs-win. Using Dokan, I can also write to files (but it crashes regularly, so I'm looking for an alternative).
The only weird thing about my server is that the home directory is on AFS, but that shouldn't be a concern for ssh (it is a relatively transparent filesystem). Also, I cannot write to /tmp, which is on the server's hard disk, and should work in any case.
I also tried using the syntax \\sshfs\winuser=remoteuser@host\path
, but it didn't have any effect. All files on the mounted drive are owned by SYSTEM, and read only.
@eric-wieser @jdmansour Apologies for not looking at any of these issues recently. I am totally focused on making WinFsp as robust and capable as possible and have not had time to look into sshfs-win.
Sshfs-win.c
is the small driver program that starts sshfs with (hopefully) the correct parameters. Sshfs-win.c
attempts to start sshfs with a -ouid=UID,gid=GID
option that matches the USER
in the \\sshfs\USER@HOST
syntax (or the LOCUSER
in the \\sshfs\LOCUSER=USER@HOST
syntax).
To fetch the UID
, GID
it does a (Cygwin) getpwnam
. The minimal Cygwin environment included in sshfs-win, should have the same usernames as Windows. Note however that if a domain username is encountered, Cygwin translates \
to +
(I believe). So for example DOMAIN\USER
becomes DOMAIN+USER
.
I also tried using the syntax
\\sshfs\winuser=remoteuser@host\path
, but it didn't have any effect. All files on the mounted drive are owned by SYSTEM, and read only.
This means that for some reason getpwnam
failed. When this happens, sshfs is started with the -ouid=-1,gid=-1
switch which makes all files owned by the account that starts sshfs (in this case SYSTEM
).
Is there any easy way to evaluate getpwnam
in the minimal cygwin environment that is included?
If you have Cygwin installed, you just need to issue id
from the bash prompt. This will tell you what uid
and gid
, Cygwin thinks you have.
If you do not have Cygwin it is harder as SSHFS-Win does not include Cygwin bash.exe
in its distribution.
If you do not have Cygwin it is harder as SSHFS-Win does not include Cygwin bash.exe in its distribution.
Yep, that was my concern. Either way, after updating both winfsp and sshfs-win, this seems to now be working just fine for me with the appropriate local user.
Bash.exe
may be a bit big to distribute, but perhaps I could just distribute /usr/bin/id
. Although it then becomes a question of complying with licenses, which is not always a fun job...
Adding sshfs-win --show-id localuser
would probably be enough to debug this issue
Hello, I know this is a bit old but after installing WinFSP and SSHFS-WIN I am able to mount to my ubuntu server through SSH and although I can create new files I can not edit any existing files (access is denied). I am logged in on a domain joined workstation and the users I am using is a separate user (which is an a sudoer on the ubuntu server). Is there any way to fix this?
@oden08 apologies for the late response.
Have you tried the following syntax:
\\sshfs\DOMAIN+WINUSER=USER@HOST\PATH
I have similar problem, after a little bit debugging, I can see that, parameters passed as:
-ouid=4096 ,gid=4096
which is matching on my cygwin install, output of id command
but when I looked at the files on cygwin, i see user, and group as -1
I have this same problem with permission. I can set up a connection via 'map network drive', but only with READ permission. Can you help me use this program by CMD and create a connection?
I have the following data:
- Windows user name: Michal
- Windows mountpoint: I don't know, please help me there (choose random).
- Windows UID: uid=197608(Michal)
- Windows GID: gid=197121(None)
- Remote IP: 192.168.2.10
- Remote directory: /home/pi
- Remote user name: pi
- Remote password: michal3
Activities I've done:
- Install latest winfsp with all optionals packages
- Install latest sshfs-win 64-bits
- Install latest cygwin 64-bits with defaults packages
- Run Cygwin-Terminal and type command: id username
- Copy UID and GID
- Look for SSHFS-Win\bin\sshfs.exe program in your disk
- Open this program through CMD
I get the following message for each connection attempt: read: Connection reset by peer
Same issue here, but I don't use Cygwin.
When I hit "Create Directory" once it creates four directories (that's another issue) with permission rwx------ 2
. I can't access them or delete them.
I have the same "read only" problem of having access to the mounted FS, but not being able to write.
Has anybody found a work-around for this? I've been searching high and low for a solution, but haven't found one.
I don't have any odd characters in my id (as mentioned in #168), so I don't think that's the issue.
I've tried setting uid and gid to those values on the target Linux system, but that didn't work. I've set the umask to 000 (though that's the default already), but that didn't work.
I would like to be able to use a Windows based editor on Linux files using ssh-win. If I can't get this working, I'll have to use vim over Putty/ssh. Vim is ok for quick edits, but I'd rather not for "hardcore" development.
Using sshfs-win.exe I also get only readonly access.
I added -o uid=-1 -o gid=-1 to sshfs-win:
"c:\Program Files\SSHFS-Win\bin\sshfs-win.exe" cmd xxxx@yyyy: S: -o uid=-1 -o gid=-1 -o umask=002 -o create_file_umask=113 -o create_dir_umask=002 -o follow_symlinks
or
"c:\Program Files\SSHFS-Win\bin\sshfs-win.exe" cmd xxxx@yyyy:/ S: -o uid=-1 -o gid=-1 -o umask=002 -o create_file_umask=113 -o create_dir_umask=002 -o transform_symlinks
to get also write access.