Ticket #386 (reopened defect)

Opened 5 years ago

Last modified 5 years ago

can't save keys, can't write to known-hosts file

Reported by: jason.cipriani@gmail.com Owned by: alamaison
Priority: major (affects peripheral workflow) Milestone:
Component: host-key Version: 0.8.2
Keywords: Cc:

Description

When connecting to an SFTP server I cannot choose to save the key, or else I get an error "could not write to known-hosts file" (screenshot attached).

The only way I can connect is to not save the key, which presents the dialog every time. This is fine for me but not acceptable for the people I am setting this up for. It also makes it not possible to detect if the key has changed, aside from the user looking at it and manually checking if it was the same as last time (this isn't going to happen).

Windows 7 64-bit. My Windows user name is different than my username on the SFTP server.

Attachments

screenshot.png Download (17.0 KB) - added by jason.cipriani@gmail.com 5 years ago.
screenshot

Change History

Changed 5 years ago by jason.cipriani@gmail.com

screenshot

comment:1 follow-up: ↓ 2 Changed 5 years ago by alamaison

  • Component changed from undefined to host-key

Swish saves known host information in the OpenSSH known_hosts file. If you don't already have one, it creates it.

First, it looks for your home directory as set up in Windows. Usually something like C:\Users\username. The it opens (or creates) a directory .ssh in your home directory. Then in opens (or creates) a known_hosts file in that directory.

Your answers to these questions will diagnose the problem:

  • Does the known_hosts file exist? (C:\Users\<yourusername>\.ssh\known_hosts) If so, is it readable and writeable in the Windows file permissions.
  • If not, does the .ssh directory exists? Is it writeable? I.e., can you create a file in it?
  • If not, is your user directory writeable? I.e., can you create a directory in it?

comment:2 in reply to: ↑ 1 Changed 5 years ago by jason.cipriani@gmail.com

Replying to alamaison:

  • Does the known_hosts file exist? (C:\Users\<yourusername>\.ssh\known_hosts) If so, is it readable and writeable in the Windows file permissions.

It exists, and was marked read-only. Setting its permissions properly resolved the issue, so I will stop here. The problem is solved.

However, as an enhancement, I'd like to request that this particular error message be updated to include the path to the known_hosts file and a suggestion to check its permissions, if possible. With the path to this file and a potential cause available, I would have been able to resolve it on my own without interpreting it as a bug or coming here.

Thanks for your help.

comment:3 Changed 5 years ago by jason.cipriani@gmail.com

  • Status changed from new to closed
  • Resolution set to invalid

comment:4 Changed 5 years ago by alamaison

  • Status changed from closed to reopened
  • Resolution invalid deleted

Reopening so we remember to implement your suggestion.

Note: See TracTickets for help on using tickets.