GNOME Bugzilla – Bug 728959
gvfs-mount through ssh/sftp fails if host is not already in known_hosts file
Last modified: 2014-05-10 07:35:13 UTC
I reported this issue initially here: https://bugs.launchpad.net/bugs/1312289 They got back to me and asked me to file the upstream issue here. After performing a fresh install of Ubuntu 14.04, I attempted to mount a remote computer through ssh/sftp: $ gvfs-mount ssh://user@host This resulted in the error message: Error mounting location: Login dialog cancelled This had been working fine in my previous installation, so I assumed that I was missing a package, or that some configuration was wrong. After some googling, attempts at adding more packages that "might" be necessary, reboots (just to be sure), I more or less gave up and thought I'd just live without for a while and ask a question myself on askubuntu.com. Then I thought I'd try one last thing; re-install nautilus (which I normally don't use) and try to mount through the nautilus GUI. That actually *did* work, but I noticed the "authenticity" message. So I unmounted, and remounted from the command line. This time it worked normally. I deleted the "known_hosts" file. Then the error message was back. While the workaround is pretty simple, it was quite hard (at least for me) to figure out what was happening. My suggestion is to either improve the error message so that users don't have to guess at what really happened or - preferably - establish the authenticity in the normal manner also when using the gvfs-mount command.
Created attachment 275851 [details] [review] gvfs-mount: Handle the ask-question signal Present questions as a message and a numbered list of choices such that the user must enter one of the numbers. For example: """ Can't verify the identity of ... This happens when you log in to a computer the first time. The identity sent by the remote computer is ... If you want to be absolutely sure it is safe to continue, contact the system administrator. [1] Log In Anyway [2] Cancel Login Choice: 1 """
This should fix it for gvfs-mount, I will open a separate bug for nautilus.
The suggested solution to gvfs-mount looks fine to me. (In reply to comment #2) > This should fix it for gvfs-mount, I will open a separate bug for nautilus. It worked with nautilus; i.e. I got a dialog asking me to confirm authenticity of the unknown host, and when confirmed it was added to the ~/.ssh/known_hosts file.
(In reply to comment #3) > The suggested solution to gvfs-mount looks fine to me. > > (In reply to comment #2) > > This should fix it for gvfs-mount, I will open a separate bug for nautilus. > > It worked with nautilus; i.e. I got a dialog asking me to confirm authenticity > of the unknown host, and when confirmed it was added to the ~/.ssh/known_hosts > file. Oh, right, I misread your initial report.
Review of attachment 275851 [details] [review]: Good work, thanks!
Pushed to master as 84dc778fa5901. Thanks for the review.