Skip to content

"known_hosts" records incorrect SFTP address for servers with non-22 ports #10772

@cyberduck

Description

@cyberduck

c8fd01b created the issue

Hi,

In Cyberduck 7.0.2, the ~/.ssh/known_hosts file will not record SFTP server's port number, invalids the "Remember Server Signature" function. Here is the procedure to reproduce:

  1. Connect to an SFTP server that has a non-standard port, let's say "ssh.example.com:54321".
  2. Cyberduck asks you whether to remember this server signature. Choose "Always".
  3. Find a new line in the ~/.ssh/known_hosts file:
ssh.example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJRw0CtHEseIIU/6OUf/NYNKXPs5tCu6EfwUty3bzZcm
  1. Disconnect the server and repeat Step 1. Now Cyberduck asks you again for saving the signature. Choose "Always" again.
  2. Now there are two duplicate lines in ~/.ssh/known_hosts file:
ssh.example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJRw0CtHEseIIU/6OUf/NYNKXPs5tCu6EfwUty3bzZcm
ssh.example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJRw0CtHEseIIU/6OUf/NYNKXPs5tCu6EfwUty3bzZcm

This bug does not exist in Cyberduck 7.0.1. In this version, the following line is added to ~/.ssh/known_hosts when you choose to remember the signature:

[ssh.example.com]:54321 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJRw0CtHEseIIU/6OUf/NYNKXPs5tCu6EfwUty3bzZcm

which is correct. Cyberduck will not ask you to remember it again during the second connection.

You can see that the missing PORT number in Cyberduck 7.0.2 causes this bug.

Metadata

Metadata

Assignees

Labels

sftpSFTP Protocol Implementation

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions