# SFTP keys

**URL:** <https://resource.dopus.com/t/sftp-keys/39015>\
**Category:** Help & Support\
**Created:** [July 26, 2021, 5:45pm UTC](https://resource.dopus.com/t/sftp-keys/39015 "2021-07-26T17:45:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ProblemHaver](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@ProblemHaver](https://resource.dopus.com/u/ProblemHaver)\
**Post date:** [July 26, 2021, 5:45pm UTC](https://resource.dopus.com/t/sftp-keys/39015/1 "2021-07-26T17:45:33Z")

</div>

I'm trying to connect to a server using SFTP but getting the following error:

```auto
Reading private key file "C:\key"
Unable to use this key file (OpenSSH SSH-2 private key)
Disconnected: No supported authentication methods available (server sent: publickey)
SSH: Fatal: Disconnected: No supported authentication methods available (server sent: publickey)
Connection closed

```

What would be the problem here? The key works with regular sftp command.

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [July 26, 2021, 5:48pm UTC](https://resource.dopus.com/t/sftp-keys/39015/2 "2021-07-26T17:48:03Z")

</div>

> [@SFTP unable to use this key file](https://resource.dopus.com/t/sftp-unable-to-use-this-key-file/25425/2):
>
> Download PuTTYGen.exe from the [PuTTY site](http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html), load the key into it, then save it out again in PuTTY's format. That will then work with Opus (and other things based on PuTTY/Pageant).

---

<div class="post-metadata">

**Author:** ![ProblemHaver](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@ProblemHaver](https://resource.dopus.com/u/ProblemHaver)\
**Post date:** [July 26, 2021, 6:13pm UTC](https://resource.dopus.com/t/sftp-keys/39015/3 "2021-07-26T18:13:09Z")

</div>

I opened the private key in PuTTY Key Generator and pressed "save private key", saved as .ppk file. Select that in Dopus and get the following error:

```auto
Opening Connection IP_address:22
Opening Connection IP_address:22
Server version: SSH-2.0-OpenSSH_7.9 FreeBSD-20200214
Using SSH protocol version 2
We claim version: SSH-2.0-PuTTY_Directory_Opus
Server version: SSH-2.0-OpenSSH_7.9 FreeBSD-20200214
Server supports delayed compression; will try this later
Doing Diffie-Hellman group exchange
Using SSH protocol version 2
We claim version: SSH-2.0-PuTTY_Directory_Opus
Server supports delayed compression; will try this later
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-256
Doing Diffie-Hellman key exchange with hash SHA-256
Host key fingerprint is:
ssh-rsa 2048 [fingerprint]
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA-256 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA-256 server->client MAC algorithm
Host key fingerprint is:
ssh-rsa 2048 [fingerprint]
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA-256 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA-256 server->client MAC algorithm
Reading private key file "C:\key.ppk"
Unable to load private key (PuTTY key format too new)
Disconnected: No supported authentication methods available (server sent: publickey)
SSH: Fatal: Disconnected: No supported authentication methods available (server sent: publickey)
Connection closed
Reading private key file "C:\key.ppk"
Unable to load private key (PuTTY key format too new)
Disconnected: No supported authentication methods available (server sent: publickey)
SSH: Fatal: Disconnected: No supported authentication methods available (server sent: publickey)
Connection closed

```

I tried saving the private key as well as .pub but I don't think it opened the original public key, when I select the public key to open first, I get an error.

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [July 26, 2021, 6:22pm UTC](https://resource.dopus.com/t/sftp-keys/39015/4 "2021-07-26T18:22:29Z")

</div>

> [@ProblemHaver](#):
>
> `Unable to load private key (PuTTY key format too new)`

Sorry about that. Give this version of PuttyGen.exe a try:

[PUTTYGEN.zip](https://resource.dopus.com/uploads/short-url/xqOf2OynVVh3yJlhIccWXHCN49s.zip) (470.6 KB)

(You can check the exe's digital signature to verify it's legitimate and signed by the PuTTY author. It's just an older version.)

---

<div class="post-metadata">

**Author:** ![ProblemHaver](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@ProblemHaver](https://resource.dopus.com/u/ProblemHaver)\
**Post date:** [July 26, 2021, 6:45pm UTC](https://resource.dopus.com/t/sftp-keys/39015/5 "2021-07-26T18:45:19Z")

</div>

Okay, now it does not complain about key version.

```auto
Opening Connection IP_address:22
Opening Connection IP_address:22
Server version: SSH-2.0-OpenSSH_7.9 FreeBSD-20200214
Using SSH protocol version 2
We claim version: SSH-2.0-PuTTY_Directory_Opus
Server supports delayed compression; will try this later
Doing Diffie-Hellman group exchange
Server version: SSH-2.0-OpenSSH_7.9 FreeBSD-20200214
Using SSH protocol version 2
We claim version: SSH-2.0-PuTTY_Directory_Opus
Server supports delayed compression; will try this later
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-256
Doing Diffie-Hellman key exchange with hash SHA-256
Host key fingerprint is:
ssh-rsa 2048 [fingerprint]
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA-256 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA-256 server->client MAC algorithm
Host key fingerprint is:
ssh-rsa 2048 [fingerprint]
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA-256 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA-256 server->client MAC algorithm
Reading private key file "C:\key.ppk"
Reading private key file "C:\key.ppk"
Offered public key
Offered public key
Server refused our key
Disconnected: No supported authentication methods available (server sent: publickey)
SSH: Fatal: Disconnected: No supported authentication methods available (server sent: publickey)
Connection closed
Server refused our key
Disconnected: No supported authentication methods available (server sent: publickey)
SSH: Fatal: Disconnected: No supported authentication methods available (server sent: publickey)
Connection closed

```

Since it says that it's reading the private key file, it does not say that it's reading the public key file and I don't see where to specify that...  
Sftp I guess takes the file because it's a default name but since I converted this to another format I would assume I need to convert the other key as well... I'm not too familiar with this.

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [July 26, 2021, 8:16pm UTC](https://resource.dopus.com/t/sftp-keys/39015/6 "2021-07-26T20:16:21Z")

</div>

It might mean the server doesn't like any of the encryption methods Opus supports (there are newer ones we don't support yet).

It would usually list the available protocols, rather than just "publickey", but if that is the underlying issue then there isn't a solution at the moment for servers that need newer encryption methods.

---

<div class="post-metadata">

**Author:** ![ProblemHaver](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@ProblemHaver](https://resource.dopus.com/u/ProblemHaver)\
**Post date:** [July 26, 2021, 8:40pm UTC](https://resource.dopus.com/t/sftp-keys/39015/7 "2021-07-26T20:40:59Z")

</div>

Any of these supported? Should all be the default ones...

```auto
ciphers chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc
macs umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
kexalgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
casignaturealgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
hostbasedacceptedkeytypes ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-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
hostkeyalgorithms ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-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
pubkeyacceptedkeytypes ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-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

```

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [July 27, 2021, 8:09am UTC](https://resource.dopus.com/t/sftp-keys/39015/8 "2021-07-27T08:09:36Z")

</div>

Currently supported algorithms:

KEX:

- diffie-hellman-group-exchange-sha256
- diffie-hellman-group-exchange-sha1
- diffie-hellman-group14-sha1
- diffie-hellman-group1-sha1
- rsa2048-sha256
- rsa1024-sha1

Cipher:

- Blowfish-256 SDCTR
- Blowfish-128 CBC
- single-DES CBC
- triple-DES SDCTR
- triple-DES SDCTR
- triple-DES CBC
- AES-256 SDCTR
- AES-256 CBC
- AES-192 SDCTR
- AES-192 CBC
- AES-128 SDCTR
- AES-128 CBC
- Arcfour-256
- Arcfour-128

MAC:

- HMAC-SHA-256
- HMAC-SHA1
- HMAC-SHA1-96
- HMAC-MD5

---

<div class="post-metadata">

**Author:** ![ProblemHaver](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@ProblemHaver](https://resource.dopus.com/u/ProblemHaver)\
**Post date:** [July 28, 2021, 3:05am UTC](https://resource.dopus.com/t/sftp-keys/39015/9 "2021-07-28T03:05:31Z")

</div>

Looks like at least one or more of these are supported, and says in the log that it's using them.

Also, server logs on DEBUG3 just say:

```auto
error: Received disconnect from IP_address port 40261:14: No supported authentication methods available [preauth]
Disconnected from authenticating user <username> IP_address port 40261 [preauth]

```

Is there any way I can fix this?

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [July 28, 2021, 8:00am UTC](https://resource.dopus.com/t/sftp-keys/39015/10 "2021-07-28T08:00:35Z")

</div>

I'm not sure how to solve that, sorry. If the key wasn't working via other methods then the error messages would make me think the server doesn't like public key authentication at all, but that can't be true if it is working in another client.

---

<div class="post-metadata">

**Author:** ![ProblemHaver](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@ProblemHaver](https://resource.dopus.com/u/ProblemHaver)\
**Post date:** [July 28, 2021, 11:11pm UTC](https://resource.dopus.com/t/sftp-keys/39015/11 "2021-07-28T23:11:07Z")

</div>

Guess I'll have to stay on Linux with that one. Alright, thank you.

---

<div class="post-metadata">

**Author:** ![ProblemHaver](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@ProblemHaver](https://resource.dopus.com/u/ProblemHaver)\
**Post date:** [October 17, 2021, 7:18pm UTC](https://resource.dopus.com/t/sftp-keys/39015/12 "2021-10-17T19:18:37Z")

</div>

@Leo I just found out that there's a port of OpenSSH for Windows, here:

> **[GitHub - PowerShell/Win32-OpenSSH: Win32 port of OpenSSH](https://github.com/PowerShell/Win32-OpenSSH)**
>
> Win32 port of OpenSSH. Contribute to PowerShell/Win32-OpenSSH development by creating an account on GitHub.

I tested the ssh.exe and scp.exe in the latest release, they both work where PuTTY would not. Is it possible to include this in Dopus instead or in addition and provide a GUI?

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [October 17, 2021, 7:32pm UTC](https://resource.dopus.com/t/sftp-keys/39015/13 "2021-10-17T19:32:43Z")

</div>

It's quite strange if the server won't work with PuTTY, even the latest version of PuTTY (which is newer than what's in Opus). PuTTY is extremely common.

Swapping out the SSH library we use is non-trivial, although it is something we're considering for other reasons (as the PuTTY code is not really designed to be a library and quite time consuming to keep up-to-date). It's not something we would do for compatibility with one server (and where the issue isn't really understood yet), but it's something that may happen anyway. Not in the extremely near future, however, as it's not a trivial change.

---

<div class="post-metadata">

**Author:** ![ProblemHaver](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@ProblemHaver](https://resource.dopus.com/u/ProblemHaver)\
**Post date:** [October 17, 2021, 8:11pm UTC](https://resource.dopus.com/t/sftp-keys/39015/14 "2021-10-17T20:11:17Z")

</div>

I was using a Linux jump host till now, did not realize there was a Windows port - accessing everything from the main workstation is much more convenient than moving files around to a network share and copying off of it on a different host. Not to mention I cannot use Dopus during maintenance because SMB gets locked up lol.

I don't know why PuTTY doesn't accept the original files in the first place but needs conversion, seems like a kludge in an otherwise reliable app. I think PuTTY is screwing up something with the keys or I'm using the conversion tool incorectly.

The rough timeline I presume means the next couple of years?

---

<div class="post-metadata">

**Author:** ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)\
**Post date:** [March 5, 2022, 6:25am UTC](https://resource.dopus.com/t/sftp-keys/39015/15 "2022-03-05T06:25:21Z")

</div>

We have upgraded the version of PuTTY our SSH support is based on in [12.26.3 beta](https://resource.dopus.com/t/directory-opus-12-26-3-beta/40727) - this apparently should support the new OpenSSH-format keyfiles, if you'd like to give it a try.

---

<div class="post-metadata">

**Author:** ![ProblemHaver](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@ProblemHaver](https://resource.dopus.com/u/ProblemHaver)\
**Post date:** [March 23, 2022, 3:51pm UTC](https://resource.dopus.com/t/sftp-keys/39015/16 "2022-03-23T15:51:06Z")

</div>

Sorry for the delay.  
I've previously been unable to get it working with PuTTY, which is still on the same version as it was then, so any solution based on PuTTY will probably not work as well. When importing the key into PuTTY Key Generator, it only asks/takes my private key as far as I can tell.

> [@ProblemHaver](#):
>
> Since it says that it's reading the private key file, it does not say that it's reading the public key file and I don't see where to specify that...

Either I'm using it incorrectly or PuTTY doesn't support it. OpenSSH port for Windows works beautifully (scp.exe or ssh.exe), but no integration in Dopus.

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [March 23, 2022, 4:37pm UTC](https://resource.dopus.com/t/sftp-keys/39015/17 "2022-03-23T16:37:03Z")

</div>

PuTTY’s keygen tool can load and convert both public and private keys, if I remember correctly.

They would be done separately, except you usually only need the private key on the client side. The server side has the other half and is unlikely to need that to be in PuTTY’s key file format.

(You may also be able to derive the public key from the private key. It’s been a while since I did any of this. But you shouldn’t need the public key at all on the client side.)

---

<div class="post-metadata">

**Author:** ![ProblemHaver](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@ProblemHaver](https://resource.dopus.com/u/ProblemHaver)\
**Post date:** [March 23, 2022, 7:50pm UTC](https://resource.dopus.com/t/sftp-keys/39015/18 "2022-03-23T19:50:48Z")

</div>

I don't see where to load the public keys in the key generator, it only offers loading of private key, it can SAVE public key, but not load it, which doesn't help. I tried loading public key under private but it rejects it, of course ("Couldn't load private key (SSH-2 public key (OpenSSH format))").

It can indeed derive the public key from private, but it cannot sign it. It needs to send the genuine public key to the server to verify against CA.

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [March 23, 2022, 8:53pm UTC](https://resource.dopus.com/t/sftp-keys/39015/19 "2022-03-23T20:53:55Z")

</div>

You don't need to load or convert a public key at all. _You only need the private key on the client side._

Think of the private key as the password. The public key is just the thing that the server (or anyone else) can use to verify you have the private key (without needing to know what the private key is).

If you only have the public key then you can't use that to log into a server, no matter what format it's in or which software you use.

---

<div class="post-metadata">

**Author:** ![ProblemHaver](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@ProblemHaver](https://resource.dopus.com/u/ProblemHaver)\
**Post date:** [March 23, 2022, 10:52pm UTC](https://resource.dopus.com/t/sftp-keys/39015/20 "2022-03-23T22:52:39Z")

</div>

If I have just public key, then it doesn't work, I need the public key as well, the server does not have my public key, it just verifies that the CA has signed it, whatever the actual public/private key is. If I remove the public key, then it does not work with OpenSSH either.

[Next page](https://resource.dopus.com/t/sftp-keys/39015.md?page=2)
