Skip to content

Cannot climb up directories in windows explorer #37

Open

Description

@wonx

For some reason, it seems that it is no possible to climb up folders when writing the address in the windows explorer address bar. For instance:
\\sshfs\username@linux-host!9999
takes to you the user's home directory, as expected, but:
\\sshfs\username@linux-host!9999\..\..
just takes you back to the "Network" place in windows 10, instead of climbing up two folders. Trying to use absolute paths:
\\sshfs\username@linux-host!9999\\media
does not work either, an error message saying that windows could not access that destination.

However, all these commands work if they are used when creating a new network drive.

Activity

  1. billziss-gh commented on Jul 4, 2018

    @billziss-gh
    Collaborator

    The \\sshfs\user@server syntax is meant as a convenience. It is possible to use double dot .. and double backslash \\ to make SSHFS-Win access root or parent directories, but this is more of a hack.

    If you need access to root directories, etc. I recommend either enabling access to them through a user on the SSHFS server or by using the bundled sshfs directly from the command line. The sshfs command is available under \Program Files\SSHFS-Win\bin\sshfs.exe.

  2. wonx commented on Jul 4, 2018

    @wonx
    Author

    Oh, ok. How would you use the sshfs command in this case?

  3. billziss-gh commented on Jul 5, 2018

    @billziss-gh
    Collaborator

    Open a command prompt and issue something along the lines of:

    > cd \Program Files\SSHFS-Win\bin
    > sshfs -o idmap=user USER@SERVER:/path X:
    

    See man sshfs for more options. Not all will work on Windows.

  4. OskarAtGitHub commented on Jul 29, 2018

    @OskarAtGitHub

    When running the second of these commands:

    > cd \Program Files\SSHFS-Win\bin
    > sshfs -o idmap=user -d [USER]@10.1.1.1:/path X:
    

    I get a

    ssh: connect to host 10.1.1.1 port 22: Operation not permitted
    read: Connection reset by peer
    

    I have Putty also installed on a windows 7 system. Could this potentially be conflicting with the ssh command, as in the other reported "issues"?
    Mapping the drive via windows explorer works fine.

  5. billziss-gh commented on Jul 29, 2018

    @billziss-gh
    Collaborator

    When you type where ssh which ssh is being picked up?

  6. OskarAtGitHub commented on Jul 30, 2018

    @OskarAtGitHub

    This is what I get:

    C:\Program Files\SSHFS-Win\bin>where ssh
    C:\Program Files\SSHFS-Win\bin\ssh.exe
    C:\project-open\bin\ssh.exe
    
  7. 4O4 commented on Jul 30, 2018

    @4O4
    Contributor

    Putty is a standalone program, it doesn't come with it's own ssh.exe. Your where output looks fine. You have two ssh.exes in PATH but SSHFS-Win is first on the list so it is the one that is used under the hood.

    Maybe try with some additional flags, you should get more verbose output from the ssh directly:

    sshfs -o idmap=user -o debug -o sshfs_debug -o LOGLEVEL=DEBUG3 -o ssh_command="ssh -vv" -d [USER]@10.1.1.1:/path X:
    
  8. OskarAtGitHub commented on Jul 30, 2018

    @OskarAtGitHub

    Yes, I though as much from the output.
    This is what I get from the higher debug level output:

    C:\Program Files\SSHFS-Win\bin>sshfs -o idmap=user -o debug -o sshfs_debug -o LO
    GLEVEL=DEBUG3 -o ssh_command="ssh -vv" -d [USER]@10.1.1.1: X:
    
    SSHFS version 2.7
    executing <ssh> <-vv> <-x> <-a> <-oClearAllForwardings=yes> <-oLOGLEVEL=DEBUG3>
    <-2> <xxxxxxxx@10.1.1.1> <-s> <sftp>
    OpenSSH_6.1p1, OpenSSL 1.0.1c 10 May 2012
    debug1: Reading configuration data /etc/ssh_config
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to 10.1.1.1 [10.1.1.1] port 22.
    debug1: connect to address 10.1.1.1 port 22: Operation not permitted
    ssh: connect to host 10.1.1.1 port 22: Operation not permitted
    read: Connection reset by peer
    

    I assume the "needpriv 0", is the problem. I have no idea what that means though :D

    I do have whitelist firewall settings. But ssh is on it. And the network drive mapping works via windows explorer (without options).

  9. 4O4 commented on Jul 30, 2018

    @4O4
    Contributor
  10. OskarAtGitHub commented on Jul 30, 2018

    @OskarAtGitHub

    Do you mean the .ssh dir on the remote machine?
    I can't find a .ssh dir on the local windows 7 machine. I don't even have a /home/[USER] dir when viewed in Cygwin. "which ssh" returns /usr/bin/ssh
    Is this my problem?

  11. 4O4 commented on Jul 30, 2018

    @4O4
    Contributor

    Oh nevermind, it was just a blind guess. I assumed you have created the whole /home/user/.ssh tree in SSHFS-Win installation directory (because that's the only place where sshfs-win will look at) but that's clearly not the case.

    "which ssh" returns /usr/bin/ssh
    Is this my problem?

    I don't think so. But let's try one more thing - test if you can connect by just plain ssh. Run ssh.exe [USER]@10.1.1.1 -vvv from the SSHFS-Win install location (via PS or cmd) and then from Cygwin terminal (outside of the install location so it picks /usr/bin/ssh instead).

    BTW can you connect using Putty without errors?

  12. OskarAtGitHub commented on Jul 30, 2018

    @OskarAtGitHub

    Ok, I think we're getting somewhere!
    Running ssh from cmd works fine. But does give the:
    debug2: ssh_connect_direct: needpriv 0

    Running ssh from cygwin (from /cygdrive/c/Program Files/SSHFS-Win/bin) gives the same error as above, but results in
    ssh: connect to host 10.1.1.1 port 22: Operation not permitted
    ...regardless of which directory I run the ssh command from.

    edit: yes Putty works without problems. I can run remote X and everything.

  13. 4O4 commented on Jul 30, 2018

    @4O4
    Contributor

    Can you paste the exact output from both cases?

  14. OskarAtGitHub commented on Jul 30, 2018

    @OskarAtGitHub

    from cmd:

    C:\Program Files\SSHFS-Win\bin>ssh [USER]-local@10.1.1.1 -vvv
    OpenSSH_7.5p1, OpenSSL 1.0.2k  26 Jan 2017
    debug2: resolving "10.1.1.1" port 22
    debug2: ssh_connect_direct: needpriv 0
    debug1: Connecting to 10.1.1.1 [10.1.1.1] port 22.
    debug1: Connection established.
    Could not create directory '/home/[USER]/.ssh'.
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/[USER]/.ssh/id_rsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/[USER]/.ssh/id_rsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/[USER]/.ssh/id_dsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/[USER]/.ssh/id_dsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/[USER]/.ssh/id_ecdsa type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/[USER]/.ssh/id_ecdsa-cert type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/[USER]/.ssh/id_ed25519 type -1
    debug1: key_load_public: No such file or directory
    debug1: identity file /home/[USER]/.ssh/id_ed25519-cert type -1
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_7.5
    debug1: Remote protocol version 2.0, remote software version OpenSSH_7.7
    debug1: match: OpenSSH_7.7 pat OpenSSH* compat 0x04000000
    debug2: fd 3 setting O_NONBLOCK
    debug1: Authenticating to 10.1.1.1:22 as '[USER]-local'
    debug3: send packet: type 20
    debug1: SSH2_MSG_KEXINIT sent
    debug3: receive packet: type 20
    debug1: SSH2_MSG_KEXINIT received
    debug2: local client KEXINIT proposal
    debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2
    -nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sh
    a256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-
    group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ex
    t-info-c
    debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2
    -nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25
    519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-
    sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
    debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256
    -ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-
    cbc
    debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256
    -ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-
    cbc
    debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-25
    6-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-6
    4@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-25
    6-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-6
    4@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: compression ctos: none,zlib@openssh.com,zlib
    debug2: compression stoc: none,zlib@openssh.com,zlib
    debug2: languages ctos:
    debug2: languages stoc:
    debug2: first_kex_follows 0
    debug2: reserved 0
    debug2: peer server KEXINIT proposal
    debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2
    -nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sh
    a256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-
    group14-sha256,diffie-hellman-group14-sha1
    debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp2
    56,ssh-ed25519
    debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256
    -ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
    debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256
    -ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
    debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-25
    6-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-6
    4@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-25
    6-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-6
    4@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
    debug2: compression ctos: none,zlib@openssh.com
    debug2: compression stoc: none,zlib@openssh.com
    debug2: languages ctos:
    debug2: languages stoc:
    debug2: first_kex_follows 0
    debug2: reserved 0
    debug1: kex: algorithm: curve25519-sha256
    debug1: kex: host key algorithm: ecdsa-sha2-nistp256
    debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit
    > compression: none
    debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit
    > compression: none
    debug3: send packet: type 30
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug3: receive packet: type 31
    debug1: Server host key: ecdsa-sha2-nistp256 SHA256:QKl8ioNJsxQ+Iy0Hy6WoWZcL4h6m
    ninte1sLWBiqADo
    The authenticity of host '10.1.1.1 (10.1.1.1)' can't be established.
    ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Are you sure you want to continue connecting (yes/no)? yes
    Failed to add the host to the list of known hosts (/home/[USER]/.ssh/known_hosts)
    .
    debug3: send packet: type 21
    debug2: set_newkeys: mode 1
    debug1: rekey after 134217728 blocks
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug3: receive packet: type 21
    debug1: SSH2_MSG_NEWKEYS received
    debug2: set_newkeys: mode 0
    debug1: rekey after 134217728 blocks
    debug2: key: /home/[USER]/.ssh/id_rsa (0x0)
    debug2: key: /home/[USER]/.ssh/id_dsa (0x0)
    debug2: key: /home/[USER]/.ssh/id_ecdsa (0x0)
    debug2: key: /home/[USER]/.ssh/id_ed25519 (0x0)
    debug3: send packet: type 5
    debug3: receive packet: type 7
    debug1: SSH2_MSG_EXT_INFO received
    debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rs
    a-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,n
    ull>
    debug3: receive packet: type 6
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug3: send packet: type 50
    debug3: receive packet: type 51
    debug1: Authentications that can continue: publickey,password,keyboard-interacti
    ve
    debug3: start over, passed a different list publickey,password,keyboard-interact
    ive
    debug3: preferred publickey,keyboard-interactive,password
    debug3: authmethod_lookup publickey
    debug3: remaining preferred: keyboard-interactive,password
    debug3: authmethod_is_enabled publickey
    debug1: Next authentication method: publickey
    debug1: Trying private key: /home/[USER]/.ssh/id_rsa
    debug3: no such identity: /home/[USER]/.ssh/id_rsa: No such file or directory
    debug1: Trying private key: /home/[USER]/.ssh/id_dsa
    debug3: no such identity: /home/[USER]/.ssh/id_dsa: No such file or directory
    debug1: Trying private key: /home/[USER]/.ssh/id_ecdsa
    debug3: no such identity: /home/[USER]/.ssh/id_ecdsa: No such file or directory
    debug1: Trying private key: /home/[USER]/.ssh/id_ed25519
    debug3: no such identity: /home/[USER]/.ssh/id_ed25519: No such file or directory
    
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup keyboard-interactive
    debug3: remaining preferred: password
    debug3: authmethod_is_enabled keyboard-interactive
    debug1: Next authentication method: keyboard-interactive
    debug2: userauth_kbdint
    debug3: send packet: type 50
    debug2: we sent a keyboard-interactive packet, wait for reply
    debug3: receive packet: type 60
    debug2: input_userauth_info_req
    debug2: input_userauth_info_req: num_prompts 1
    Password:
    debug3: send packet: type 61
    debug3: receive packet: type 60
    debug2: input_userauth_info_req
    debug2: input_userauth_info_req: num_prompts 0
    debug3: send packet: type 61
    debug3: receive packet: type 52
    debug1: Authentication succeeded (keyboard-interactive).
    Authenticated to 10.1.1.1 ([10.1.1.1]:22).
    debug1: channel 0: new [client-session]
    debug3: ssh_session2_open: channel_new: 0
    debug2: channel 0: send open
    debug3: send packet: type 90
    debug1: Requesting no-more-sessions@openssh.com
    debug3: send packet: type 80
    debug1: Entering interactive session.
    debug1: pledge: network
    debug3: receive packet: type 80
    debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
    debug3: receive packet: type 91
    debug2: callback start
    debug2: fd 3 setting TCP_NODELAY
    debug3: ssh_packet_set_tos: set IP_TOS 0x10
    debug2: client_session2_setup: id 0
    debug2: channel 0: request pty-req confirm 1
    debug3: send packet: type 98
    debug2: channel 0: request shell confirm 1
    debug3: send packet: type 98
    debug2: callback done
    debug2: channel 0: open confirm rwindow 0 rmax 32768
    debug3: receive packet: type 99
    debug2: channel_input_status_confirm: type 99 id 0
    debug2: PTY allocation request accepted on channel 0
    debug2: channel 0: rcvd adjust 2097152
    debug3: receive packet: type 99
    debug2: channel_input_status_confirm: type 99 id 0
    debug2: shell request accepted on channel 0
    Last login: Mon Jul 30 18:58:01 2018 from 10.10.10.1
    Have a lot of fun...
    [USER]-local@[SERVER]:~>
    
  15. OskarAtGitHub commented on Jul 30, 2018

    @OskarAtGitHub

    And from cygwin:
    (not sure if it makes a difference or not, but result is the same with "ssh.exe")

    sh-4.1$ pwd
    /cygdrive/c/Program Files/SSHFS-Win/bin
    sh-4.1$
    sh-4.1$ ssh [USER]-local@10.1.1.1 -vvv
    OpenSSH_6.1p1, OpenSSL 1.0.1c 10 May 2012
    debug1: Reading configuration data /etc/ssh_config
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to 10.1.1.1 [10.1.1.1] port 22.
    debug1: connect to address 10.1.1.1 port 22: Operation not permitted
    ssh: connect to host 10.1.1.1 port 22: Operation not permitted
    sh-4.1$ cd ..
    sh-4.1$ ssh [USER]-local@10.1.1.1 -vvv
    OpenSSH_6.1p1, OpenSSL 1.0.1c 10 May 2012
    debug1: Reading configuration data /etc/ssh_config
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to 10.1.1.1 [10.1.1.1] port 22.
    debug1: connect to address 10.1.1.1 port 22: Operation not permitted
    ssh: connect to host 10.1.1.1 port 22: Operation not permitted
    sh-4.1$
    
  16. 4O4 commented on Jul 30, 2018

    @4O4
    Contributor

    Well, looking at the version strings (OpenSSH_6.1p1, OpenSSL 1.0.1c 10 May 2012) it appears that sshfs.exe is indeed using cygwin's ssh binary. Now when I think about it it's pretty obvious and logical - you're using sshfs.exe directly while only using sshfs-win.exe guarantees that the bundled ssh.exe is used instead of the random ones from PATH.

    Why, however, is the ssh from cygwin distro throwing these erors? I have no idea but this binary is so old that it is not even worth debugging any further. You may try to update it if possible (IDK what is the latest version available there).

    Although personally I'd just force sshfs.exe to use its bundled ssh.exe because we know it works well. While it's not pretty solution at all, it should do the job for now.

    sshfs -o idmap=user -o ssh_command="/cygdrive/c/Program Files/SSHFS-Win/bin/ssh.exe" [USER]@10.1.1.1:/path X:
    
  17. OskarAtGitHub commented on Jul 30, 2018

    @OskarAtGitHub

    Command results in:
    read: Connection reset by peer
    Can't figure out how to get the -vvv to work.

  18. billziss-gh commented on Jul 30, 2018

    @billziss-gh
    Collaborator

    @OskarAtGitHub is it possible to SSH into the server using the SSH that is bundled with SSHFS-Win?

    Please try this from a normal command prompt and not a Cygwin prompt.

  19. 4O4 commented on Jul 31, 2018

    @4O4
    Contributor

    @billziss-gh yup, we've already confirmed it works correctly outisde of cyg term (#37 (comment))

  20. OskarAtGitHub commented on Jul 31, 2018

    @OskarAtGitHub

    Some further testing from cygwin:

    ./ssh.exe [USER]@10.1.1.1 -vvv
    ...
    debug1: Connection established.
    ...
    debug1: read_passphrase: can't open /dev/tty: No such device or address
    Host key verification failed.
    sh-4.1$
    
  21. 4O4 commented on Aug 2, 2018

    @4O4
    Contributor

    @OskarAtGitHub Sorry, the last command I typed is wrong because /cygdrive is not really available in this minimal environment. Give this one a try instead. Use powershell or cmd.

    sshfs -o idmap=user -o ssh_command="/bin/ssh.exe -vvv" [USER]@10.1.1.1:/path X:
    
  22. OskarAtGitHub commented on Aug 4, 2018

    @OskarAtGitHub

    Yes, that works! Huge thanks!
    I'll try playing around with the options to see if I can work on some performance and access issues :)

  23. OskarAtGitHub commented on Aug 4, 2018

    @OskarAtGitHub

    This must be the dumbest problem I've had so far.
    But can't figure out how to "unmount" the drive when mounted like this. Windows explorer has it as a local "FUSE" drive, not a network "FUSE-SSHFS" as when using the explorer map drive.
    Windows explorer doesn't show a disconnect option, and:

    >net use X: /d
    The network connection could not be found.
    
  24. 4O4 commented on Aug 4, 2018

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions