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

SFTP - error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain #4177

Closed
99ACA opened this issue Apr 28, 2020 · 23 comments

Comments

@99ACA
Copy link

99ACA commented Apr 28, 2020

What is the problem you are having with rclone?

Error while trying to connect into specific SFTP.

What is your rclone version (output from rclone version)

rclone v1.51.0

  • os/arch: linux/amd64
  • go version: go1.13.7

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Linux - Ubuntu

Which cloud storage system are you using? (eg Google Drive)

SFTP

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone lsd remote_sftp:

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

2020/04/27 23:03:33 DEBUG : pacer: low level retry 7/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2020/04/27 23:03:44 DEBUG : pacer: low level retry 8/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
...
2020/04/27 23:04:04 Failed to create file system for "XXXXXX:": NewFs: couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain

More information:
FileZilla is working also sftp command line (OpenSSH).

/etc/ssh/ssh_config

Host *
   PasswordAuthentication yes

rclone.config

[c_sftp]
type = sftp                                   
host = sftp.XXXXX.com                  
user = YYYY                           
pass = XXXXXXXXXX
disable_hashcheck = true 
set_modtime = false
@ncw
Copy link
Member

ncw commented Apr 29, 2020

Hmm, that is a puzzle!

ssh: unable to authenticate, attempted methods [none], no supported methods remain

I think your config should be working. What appears to have happened is that the server and client have negotiated the authentication together and come up with no allowed methods.

What do you know about the server?

Can you upload a complete log with -vv please?

You could also try this - not sure it will help but it is easy to try!

--sftp-use-insecure-cipher      Enable the use of insecure ciphers and key exchange methods.

@FireMasterK
Copy link

FireMasterK commented May 1, 2020

I'm facing the same issue on the latest version.
Config: https://paste.ubuntu.com/p/B9X2Cpnyv8/
Log with -vv: https://paste.ubuntu.com/p/5HDcXyM9Mr/
I'm trying to use rclone along with sourceforge's ssh server.

Edit: Not sure if this matters but I'm running a minified image of ubuntu 18.04.

@Firefly1337
Copy link

Same issue here. I'll spare us further logs as they are absolutely identical to the ones already posted above.
Only difference on my end is that I'm not using a password but a private key (PEM format). Regular SSH and SFTP from the command line work just fine.
I temporarily changed my SSH server to use password authentication but that didn't help.

I tested several previous versions until v1.48.0 and the error is the same. The latest version v1.51.0 has some delay though before the error message appears. Older versions print it out instantaneously.
Both my hosts are Debian, SSH server is OpenSSH_7.4p1 Debian-10+deb9u7.

No idea what other info I can provide, the logs don't show anything. For some reason rclone is unable to detect the proper authentication method and just prints out 'none'.

@99ACA
Copy link
Author

99ACA commented May 1, 2020

@ncw , thanks for replay
Yes, there is problem in client & server negotiation but the current problem doesn't related to machine configuration (sftp command line is working).

I try with --sftp-use-insecure-cipher same issue (add the log)

With SFTP -vv

...
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
...
debug2: we did not send a packet, disable method
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
...
debug1: Authentication succeeded (keyboard-interactive).

With Rclone

2020/05/01 12:58:50 DEBUG : rclone: Version "v1.51.0" starting with parameters ["./rclone" "-vv" "--sftp-use-insecure-cipher" "lsd" "AAA:"]
2020/05/01 12:58:50 DEBUG : Using config file from "/home/XXX/.config/rclone/rclone.conf"
2020/05/01 12:59:01 DEBUG : pacer: low level retry 1/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2020/05/01 12:59:01 DEBUG : pacer: Rate limited, increasing sleep to 200ms
2020/05/01 12:59:11 DEBUG : pacer: low level retry 2/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2020/05/01 12:59:11 DEBUG : pacer: Rate limited, increasing sleep to 400ms
2020/05/01 12:59:21 DEBUG : pacer: low level retry 3/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2020/05/01 12:59:21 DEBUG : pacer: Rate limited, increasing sleep to 800ms
2020/05/01 12:59:32 DEBUG : pacer: low level retry 4/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2020/05/01 12:59:32 DEBUG : pacer: Rate limited, increasing sleep to 1.6s
2020/05/01 12:59:42 DEBUG : pacer: low level retry 5/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2020/05/01 12:59:42 DEBUG : pacer: Rate limited, increasing sleep to 2s
2020/05/01 12:59:52 DEBUG : pacer: low level retry 6/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2020/05/01 13:00:03 DEBUG : pacer: low level retry 7/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2020/05/01 13:00:13 DEBUG : pacer: low level retry 8/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2020/05/01 13:00:23 DEBUG : pacer: low level retry 9/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2020/05/01 13:00:34 DEBUG : pacer: low level retry 10/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain)
2020/05/01 13:00:34 Failed to create file system for "AAA:": NewFs: couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain

@darthShadow
Copy link
Member

darthShadow commented May 2, 2020

Based on the logs, it looks like keyboard-interactive is the only method allowed on the server and that is not supported by rclone yet.

Based on what is required, it could be as simple as simply sending the password every time for each question as shown here: https://gist.github.com/benmcginnis/de39c37ae4b1456790eb

@99ACA
Copy link
Author

99ACA commented May 2, 2020

Based on the logs, it looks like keyboard-interactive is the only method allowed on the server and that is not supported by rclone yet.

Based on what is required, it could be as simple as simply sending the password every time for each question as shown here: https://gist.github.com/benmcginnis/de39c37ae4b1456790eb

Great, we found out the issue (i didn't know the rclone not support keyboard-interactive).
Hmmm, the password sent only once, after that ssh tunnel is created.

Is there plan to enrich SFTP capability with the current feature, keyboard-interactive?
Do you know when?

10x

@darthShadow
Copy link
Member

It shouldn't be too difficult to add it if you want to give it a try?

You will need to add the keyboard-interactive method after this line:

@99ACA
Copy link
Author

99ACA commented May 2, 2020

thanks for the opportunity, I will try (first I need to finish )

It shouldn't be too difficult to add it if you want to give it a try?

You will need to add the keyboard-interactive method after this line:

Thanks for the opportunity.
I will try (first I need to finish another project), hopefully in the next weeks.

@rtsisyk
Copy link

rtsisyk commented Aug 10, 2020

I have same problem:

2020/08/10 21:19:43 DEBUG : pacer: Rate limited, increasing sleep to 2s
2020/08/10 21:19:45 DEBUG : pacer: low level retry 6/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2020/08/10 21:19:47 DEBUG : pacer: low level retry 7/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2020/08/10 21:19:49 DEBUG : pacer: low level retry 8/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2020/08/10 21:19:51 DEBUG : pacer: low level retry 9/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2020/08/10 21:19:53 DEBUG : pacer: low level retry 10/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)

This server uses publickey authentication:

debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: cardno:XXXX RSA SHA256:[CUT] agent
debug1: Server accepts key: cardno:XXX RSA SHA256:[CUT] agent
debug1: Authentication succeeded (publickey).

@Xyz00777
Copy link

is there any kind of workaround? i tried it with --sftp-ask-password but then its also not working :/

@ncw
Copy link
Member

ncw commented Dec 27, 2020

Can you try the latest beta? This got some fixes in this area recently bbddadb and 9e925be

@Xyz00777
Copy link

still dont working :( i also tried it with remove the ask apssword and used the ask password advanced config of sftp remote setup

ncw added a commit that referenced this issue Dec 29, 2020
Some ssh servers are set up with keyboard interactive authentication
which previously the sftp backkend was ignoring.
@ncw
Copy link
Member

ncw commented Dec 29, 2020

Can you try this please?

Both with a password in the config file and with using --sftp-ask-password

Hopefully this will work... (this is based on the idea in #4177 (comment) )

v1.54.0-beta.5012.58f89a4d7.fix-4177-sftp-keyboard-interactive on branch fix-4177-sftp-keyboard-interactive (uploaded in 15-30 mins)

@Xyz00777
Copy link

NICE! fixexd!
both config works!
image
image
Good Job :)

@ncw ncw closed this as completed in ba51409 Dec 29, 2020
@ncw
Copy link
Member

ncw commented Dec 29, 2020

Thank you for testing @Xyz00777

I've merged this to master now which means it will be in the latest beta in 15-30 mins and released in v1.54

@miguelpuyol
Copy link

Hi @ncw

this does not work with the latest beta from yesterday.

Could you please generate a new beta with these changes?

Thanks in advance!

@ncw
Copy link
Member

ncw commented Jan 30, 2021

this does not work with the latest beta from yesterday.

The current beta has these changes in.

I suggest you open a new issue with full details in the issue template - thanks

negative0 pushed a commit to negative0/rclone that referenced this issue Aug 13, 2021
Some ssh servers are set up with keyboard interactive authentication
which previously the sftp backkend was ignoring.
@weberc2
Copy link

weberc2 commented May 7, 2022

Hi @ncw, it's unclear to me if I'm experiencing the same issue or not, but I'm getting the same error and sftp user@host <<< 'put /tmp/test /tmp/test' works just fine while rclone does not. My server doesn't support password auth at all. Please let me know if I'm doing something wrong, if you need more details, or if I should open a new issue for this.

$ rclone --version
rclone v1.58.0
- os/version: darwin 12.0.1 (64 bit)
- os/kernel: 21.1.0 (x86_64)
- os/type: darwin
- os/arch: amd64
- go/version: go1.17.8
- go/linking: dynamic
- go/tags: none
[remote]
type = sftp
host = host
user = user
$ rclone copy -vv /tmp/test remote:/tmp/test
2022/05/07 11:45:04 DEBUG : rclone: Version "v1.58.0" starting with parameters ["rclone" "copy" "-vv" "/tmp/test" "remote:/tmp/test"]
2022/05/07 11:45:04 DEBUG : Creating backend with remote "/tmp/test"
2022/05/07 11:45:04 DEBUG : Using config file from "/Users/weberc2/.config/rclone/rclone.conf"
2022/05/07 11:45:04 DEBUG : fs cache: adding new entry for parent of "/tmp/test", "/tmp"
2022/05/07 11:45:04 DEBUG : Creating backend with remote "remote:/tmp/test"
2022/05/07 11:45:04 DEBUG : pacer: low level retry 1/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2022/05/07 11:45:04 DEBUG : pacer: Rate limited, increasing sleep to 200ms
2022/05/07 11:45:04 DEBUG : pacer: low level retry 2/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2022/05/07 11:45:04 DEBUG : pacer: Rate limited, increasing sleep to 400ms
2022/05/07 11:45:05 DEBUG : pacer: low level retry 3/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2022/05/07 11:45:05 DEBUG : pacer: Rate limited, increasing sleep to 800ms
2022/05/07 11:45:05 DEBUG : pacer: low level retry 4/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2022/05/07 11:45:05 DEBUG : pacer: Rate limited, increasing sleep to 1.6s
2022/05/07 11:45:06 DEBUG : pacer: low level retry 5/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2022/05/07 11:45:06 DEBUG : pacer: Rate limited, increasing sleep to 2s
2022/05/07 11:45:08 DEBUG : pacer: low level retry 6/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2022/05/07 11:45:09 DEBUG : pacer: low level retry 7/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2022/05/07 11:45:11 DEBUG : pacer: low level retry 8/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2022/05/07 11:45:13 DEBUG : pacer: low level retry 9/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2022/05/07 11:45:15 DEBUG : pacer: low level retry 10/10 (error couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
2022/05/07 11:45:15 Failed to create file system for "remote:/tmp/test": NewFs: couldn't connect SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

@ncw
Copy link
Member

ncw commented May 7, 2022

@weberc2 try v1.58.1 I think that might fix it. If it doesn't open a new issue with a log with -vv

@outofphase
Copy link

I had similar/same issue using current Ubuntu distribution version:

rclone v1.53.3-DEV
- os/arch: linux/amd64
- go version: go1.18

on SSH access to local container using public key auth. Upgrading to latest executable from website fixed this for me.

rclone v1.59.2
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-48-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.18.6
- go/linking: static
- go/tags: none

Thank you.

@ovidiugabriel
Copy link

The issue is still happening on rclone v1.60.1

My understanding is that I have to set --sftp-ask-password command line switch then I have to disable it in rclone.config by using ask_password = false.
I did it and I have the same problem.

@ncw
Copy link
Member

ncw commented Nov 29, 2022

@ovidiugabriel can you post on forum.rclone.org about this please?

@zuik
Copy link

zuik commented Apr 3, 2023

I had this issue with the rclone version from ubuntu

$ rclone --version
rclone v1.53.3-DEV
- os/arch: linux/amd64
- go version: go1.18.1

Updated to v1.62.2 through the script installation resolved the issue 👍.

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

No branches or pull requests