After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728959 - gvfs-mount through ssh/sftp fails if host is not already in known_hosts file
gvfs-mount through ssh/sftp fails if host is not already in known_hosts file
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: sftp backend
1.20.x
Other Linux
: Normal minor
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2014-04-25 15:51 UTC by Steinar Haugen
Modified: 2014-05-10 07:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gvfs-mount: Handle the ask-question signal (2.17 KB, patch)
2014-05-04 22:32 UTC, Ross Lagerwall
committed Details | Review

Description Steinar Haugen 2014-04-25 15:51:07 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.
Comment 1 Ross Lagerwall 2014-05-04 22:32:54 UTC
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
"""
Comment 2 Ross Lagerwall 2014-05-04 22:33:38 UTC
This should fix it for gvfs-mount, I will open a separate bug for nautilus.
Comment 3 Steinar Haugen 2014-05-06 08:32:07 UTC
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.
Comment 4 Ross Lagerwall 2014-05-06 17:38:06 UTC
(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.
Comment 5 Ondrej Holy 2014-05-09 13:08:03 UTC
Review of attachment 275851 [details] [review]:

Good work, thanks!
Comment 6 Ross Lagerwall 2014-05-10 07:34:50 UTC
Pushed to master as 84dc778fa5901. Thanks for the review.