Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The login attempt fails when using the identified key not the name default #194

Open
CookedMelon opened this issue Jul 8, 2023 · 3 comments

Comments

@CookedMelon
Copy link

I'm not quite sure if this issue belongs to GUI or SSHFS itself. I've noticed that when I mount the machine using the SSH login key located at C:/User/.ssh/id_rsa, it mounts successfully. However, if I use a different file as my login key, such as id_rsa_linux, it fails to establish a connection (even though I can use id_rsa_linux to log in to SSH successfully and have correctly specified the key's path in the GUI).

success when I use "C:/Users/cc241/.ssh/id_rsa" to login

image

image

fail when I use "C:/Users/cc241/.ssh/id_rsa_linux" to login

image

image

You can see that I can login SSH with both key

image

Regarding the error messages, I ran the commands for both the failed login and the successful login, which were printed in the DEBUG OUTPUT. Here are the results:

Error report(Actually, regardless of whether I use the command that succeeded or failed in the GUI, it fails when I enter it in the command prompt (cmd), and I don't know why.)

D:\Workspace# "D:\Program Files\SSHFS\bin\sshfs.exe" [email protected]:/home/cc/Workspace F: -p22 -ovolname=mylinux -odebug -ologlevel=debug1 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oidmap=user -ouid=-1 -ogid=-1 -oumask=000 -ocreate_umask=000 -omax_readahead=1GB -oallow_other -olarge_read -okernel_cache -ofollow_symlinks -oPreferredAuthentications=publickey -oIdentityFile="C:/Users/cc241/.ssh/id_rsa_linux"
SSHFS version 3.5.2
executing <ssh> <-x> <-a> <-oClearAllForwardings=yes> <-oPort=22> <-ologlevel=debug1> <-oStrictHostKeyChecking=no> <-oUserKnownHostsFile=/dev/null> <-oPreferredAuthentications=publickey> <-oIdentityFile=C:/Users/cc241/.ssh/id_rsa_linux> <-2> <[email protected]> <-s> <sftp>
debug1: Reading configuration data C:\\Users\\cc241/.ssh/config
debug1: C:\\Users\\cc241/.ssh/config line 38: Applying options for 10.68.95.199
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to 10.68.95.199 [10.68.95.199] port 22.
debug1: Connection established.
debug1: identity file C:/Users/cc241/.ssh/id_rsa_linux type 0
debug1: identity file C:/Users/cc241/.ssh/id_rsa_linux-cert type -1
debug1: identity file C:\\Users\\cc241\\.ssh\\id_rsa_linux type 0
debug1: identity file C:\\Users\\cc241\\.ssh\\id_rsa_linux-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.7
debug1: compat_banner: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.7 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 10.68.95.199:22 as 'cc'
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:13lM2XtbBMi3QquvD9lciTbHRV8QjE2Dx59u749R9wM
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file or directory
Warning: Permanently added '10.68.95.199' (ED25519) to the list of known hosts.
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: Will attempt key: C:/Users/cc241/.ssh/id_rsa_linux RSA SHA256:j2SgqKpfjkK7f8kfU8F0U4zNvfG6OizWjuDW4uJWPVw explicit
debug1: Will attempt key: C:\\Users\\cc241\\.ssh\\id_rsa_linux RSA SHA256:j2SgqKpfjkK7f8kfU8F0U4zNvfG6OizWjuDW4uJWPVw explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: C:/Users/cc241/.ssh/id_rsa_linux RSA SHA256:j2SgqKpfjkK7f8kfU8F0U4zNvfG6OizWjuDW4uJWPVw explicit
debug1: Server accepts key: C:/Users/cc241/.ssh/id_rsa_linux RSA SHA256:j2SgqKpfjkK7f8kfU8F0U4zNvfG6OizWjuDW4uJWPVw explicit
debug1: Authentication succeeded (publickey).
Authenticated to 10.68.95.199 ([10.68.95.199]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Remote: /home/cc/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /home/cc/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Sending subsystem: sftp
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3208, received 2992 bytes, in 0.2 seconds
Bytes per second: sent 15513.0, received 14468.5
debug1: Exit status 0
read: Connection reset by peer
@RFDarter
Copy link

RFDarter commented Aug 27, 2023

Same problem for me.
It must be a sshfs-win-manage problem since in SiriKali I can specify my path to the key and it works fine.

[Edit]
I did some more testing and it seems as soon as you add a second entry to the connections it uses your specified path to e key file just fine, even if you delete the etries again.

@danje57
Copy link

danje57 commented Nov 6, 2023

I think I've the same issue:

date: 2023-11-06T18:27:07.681Z conn: {aa4d0e80-8993-4d61-adf3-bb6d333f535d} (FL-BANK-SFTP) conntype: key-file {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: SSHFS version 3.5.2 {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: -oStrictHostKeyChecking=no> <-oUserKnownHostsFile=/dev/null> <-oPreferredAuthentications=publickey> <-oIdentityFile="C:/Users/admin/.ssh/OLD/id_rsa_empty"> <-2> <[email protected]> <-s> <sftp> {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: debug1: Connection established. {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: debug1: identity file C:/Users/admin/.ssh/OLD/id_rsa_empty type 0 {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: debug1: identity file C:/Users/admin/.ssh/OLD/id_rsa_empty-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.4 {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: debug1: expecting SSH2_MSG_KEX_ECDH_REPLY {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: debug1: Server host key: ecdsa-sha2-nistp256 SHA256:eJYm5c3SenRqA2slQXQKEbG1zvbOai/YitasPUvCU90 {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: debug1: SSH2_MSG_SERVICE_ACCEPT received {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: debug1: Authentications that can continue: password,publickey,keyboard-interactive debug1: Next authentication method: publickey {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: debug1: Offering public key: C:/Users/admin/.ssh/OLD/id_rsa_empty RSA SHA256:ICQ4zrkZC019t1HB5Bl5mn1vw4VqmWPrzno0Py85g4s explicit {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: debug1: Server accepts key: C:/Users/admin/.ssh/OLD/id_rsa_empty RSA SHA256:ICQ4zrkZC019t1HB5Bl5mn1vw4VqmWPrzno0Py85g4s explicit Load key "C:/Users/admin/.ssh/OLD/id_rsa_empty": invalid format debug1: No more authentication methods to try. [email protected]: Permission denied (password,publickey,keyboard-interactive). {aa4d0e80-8993-4d61-adf3-bb6d333f535d} stderr: read: Connection reset by peer {aa4d0e80-8993-4d61-adf3-bb6d333f535d} exit: 1

I tried with no passphrase, with passphrase it is the same

I tried with key generated byopenssh and putty, it is the same...

However whith SFTP Drive it works.... so key and configuration are goods.

@LeoShivas
Copy link

With Notepad++, please :

  • change EOL to UNIX (LF)
  • be sure to terminate by a newline
    image
    image

That has solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants