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 618091 - Keeps asking for password when trying to mount Samba share
Keeps asking for password when trying to mount Samba share
Status: RESOLVED NOTGNOME
Product: gvfs
Classification: Core
Component: smb backend
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2010-05-08 09:41 UTC by Marco Rodrigues
Modified: 2016-04-27 09:22 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30


Attachments
Here is the log you requested (155.75 KB, text/x-log)
2016-04-22 16:03 UTC, johnf90.964
Details
output of terminal session (10.40 KB, text/plain)
2016-04-25 12:36 UTC, johnf90.964
Details

Description Marco Rodrigues 2010-05-08 09:41:03 UTC
This bug has been reported here:

https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/510059

Can't connect to Windows 7 shared folder using gvfs-mount.

1- Works with sudo mount -t cifs //192.168.1.3/stuff /home/kmos/x -o username=kmos
2- Doesn't work with sudo gvfs-mount 'smb://kpc2/stuff'
Comment 1 Christian Persch 2010-05-08 14:45:15 UTC
-> gvfs
Comment 2 Tomas Bzatek 2010-05-28 15:10:08 UTC
Please don't use sudo with gvfs, it will mostly fail with DBus permission error. Also, this is a user mount, visible only to current user, it's not a replacement for system-wide mount command.

Please report your smbclient version, not all samba versions support new Windows CIFS modifications.
Comment 3 Marco Rodrigues 2010-05-28 15:15:14 UTC
Hi!

As you requested, here is the current version of smbclient in Ubuntu Lucid 10.04.

$ smbclient --version
Version 3.4.7
Comment 4 hilaire.drouineau 2011-08-05 06:25:02 UTC
Hi, I have the same problem under Ubuntu Natty when trying to connect to a server;

$ sudo mount -t cifs -o username=dom/user //reseau/machine /mnt/mount

works, while:

$ gvfs-mount "smb://reseau/machine"

Keeps asking for authentification information.

$ smbclient --version
Version 3.5.8
Comment 5 Tomas Bzatek 2011-08-05 11:33:36 UTC
(In reply to comment #4)
> $ sudo mount -t cifs -o username=dom/user //reseau/machine /mnt/mount
> 
> works, while:
> 
> $ gvfs-mount "smb://reseau/machine"
> 
> Keeps asking for authentification information.

I would guess that specifying "dom/user" would fail - gvfs-mount should ask for user, domain and password separately. Alternatively, Nautilus should present you a password prompt dialog, separating these three fields. Can you please try that, possibly also without specifying the domain?
Comment 6 hilaire.drouineau 2011-08-05 11:37:41 UTC
I have tried all those solutions without any success: gvf-mount effectively asks me for user, domain, pass and it doesn't work whatever I answer (user, domain, pass - domain/user, empty, pass - user, empty, pass). Same problem with nautilus (in fact I first notice the problem with nautilus and that's why I tried with the command line).
Thanks for your help
Comment 7 Florian Klink 2011-12-22 00:01:09 UTC
I also have the same problem.

Mounting the share with

mount.cifs //srv/share-rw /mnt/x -o user=myuser

works, he asks for the password and then mounts successfully.


But when I try to mount it with gnome/gvfs, it fails. I get a "infinite loop" asking for username/domain/password all the time, no matter what I type.

On the console, it looks like that:


gvfs-mount smb://srv/share-rw
Password required for share share-rw on srv
User [flokli]: myuser
Domain [WORKGROUP]: 
Password: 
Password required for share share-rw on srv
User [flokli]: 

so it keeps asking me, even though the password is correct.

I also have a share called "share", this one can be acessed without any password, and is mounted through gvfs-mount without asking for authentification. So "guest mode" works.


Any ideas how to debug this? Will attach more info if needed, I can also test some patches ;-)

system: gentoo amd64, linux-3.2.0-rc6, gvfs-1.10.1, samba-3.6.1


smb.conf without comments:

[global]
   workgroup = WORKGROUP
   server string = srv
   security = share
   load printers = no
   log file = /var/log/samba.log
   log level = 0
   max log size = 50000
   dns proxy = no
[homes]
   comment = Home Directories
   browseable = no
   writable = yes
[printers]
   comment = All Printers
   path = /var/spool/samba
   browseable = no
   guest ok = no
   writable = no
   printable = yes
[share]
  path = /opt/share/ro
  writable = no
  printable = no
  guest ok = yes
[share-rw]
  path = /opt/share/rw
  valid users = myuser
  writable = yes
  create mask = 644
  directory mask = 755
Comment 8 Luis Menina 2012-04-25 13:56:57 UTC
I've also been hit by this bug today (GNOME 3.4, Debian testing). It makes impossible mounting a smb share using nautilus. It has been open for 2 years, please don't forget it!
Comment 9 Bastien Nocera 2012-04-25 14:06:49 UTC
(In reply to comment #8)
> I've also been hit by this bug today (GNOME 3.4, Debian testing). It makes
> impossible mounting a smb share using nautilus.

It doesn't. It makes it impossible to mount an smb share _that requires a domain_ (apparently). Mounting smb shares is something I do on a daily basis, so it's not as widespread as you might think.
Comment 10 Florian Klink 2012-05-15 22:53:35 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > I've also been hit by this bug today (GNOME 3.4, Debian testing). It makes
> > impossible mounting a smb share using nautilus.
> 
> It doesn't. It makes it impossible to mount an smb share _that requires a
> domain_ (apparently). Mounting smb shares is something I do on a daily basis,
> so it's not as widespread as you might think.


How do you configure Samba to ask for a password without asking for a domain? (security = share)
Comment 11 Florian Klink 2012-06-04 17:56:25 UTC
Still no luck with gvfs-1.12.3...
Comment 12 enno+gnome 2012-06-28 08:36:47 UTC
gvfs: 1.12.1-0ubuntu1 (Ubuntu 12.04)

I have a similar issue connecting to a share on a Windows Server 2003.

Connecting using mount.cifs always works (using ntlm or ntlmv2).

Using gvfs-mount it only works, if I give the domain in UPPERCASE letters _or_ if I disable ntlmv2, which makes gvfs-mount/samba using ntlm.
My lazy default is writing the domain lowercase.

My problem is: Case of domain only matters, if I'm using gvfs-mount with ntlmv2, which is the default.
The workaround propagated in the web makes people fall back to ntlm or lanman (see referenced launchpad bug comment 29), which are unsecure.
Perhaps some of them experience the same issue.

Especially if you have domains of the form sub.domain.tld, it is very unintuitive to the user, that this has to be uppercase.

Is there a reason you don't let just gvfs-mount convert the given domain to uppercase, if this is needed?
Comment 13 Florian Klink 2013-03-12 16:17:53 UTC
For me, the workaround with disabling ntlmv2 or writing domain in uppercase doesn't work.
I tried various suggestions from the referenced launchpad bug, but no luck.

(still using configuration from comment 7)

Now at samba-3.6.10 and gvfs-1.14.2...
Comment 14 johnf90.964 2016-04-21 15:55:44 UTC
I am also having this problem. I can get into my windows shares from a mint 17.3 PC with samba version 2:4.1.6. When I did the latest update to 2:4.3.8, I can still "see" the shares but when I try to access them I get the password needed window. The windows shares are on a windows 2000 server, the linux kernel is 4.5.0-040500. No other changes are done to either server or client other than the samba update.
I am a new user so if more information is needed please send commands needed to create the information needed.
Comment 15 Ondrej Holy 2016-04-22 08:05:16 UTC
(In reply to johnf90.964 from comment #14)
> I am also having this problem. I can get into my windows shares from a mint
> 17.3 PC with samba version 2:4.1.6. When I did the latest update to 2:4.3.8,
> I can still "see" the shares but when I try to access them I get the
> password needed window. The windows shares are on a windows 2000 server, the
> linux kernel is 4.5.0-040500. No other changes are done to either server or
> client other than the samba update.

So it is probably some bug in samba. Let's try to obtain debug log. Please follow the steps:
1/ run in terminal:
pkill gvfs; GVFS_DEBUG=1 GVFS_SMB_DEBUG=99 $(find /usr/lib* -name 'gvfsd') &> ~/gvfsd.log
2/ try to connect to the server, fill and submit the password needed prompt once, then cancel the prompt
3/ provide gvfsd.log from your home directory
Comment 16 johnf90.964 2016-04-22 16:03:26 UTC
Created attachment 326561 [details]
Here is the log you requested

Tried to send the log via email as a reply to your email, but it bounced . Hope this will get it to you
Comment 17 Ondrej Holy 2016-04-25 09:28:01 UTC
Thanks for the log. It is some negotiation failure relevant to NTLM2:

BAD SIG NTLM2: wanted signature of
...
BAD SIG: got signature of
...
NTLMSSP NTLM2 packet check failed due to invalid signature!
GENSEC SPNEGO: failed to verify mechListMIC: NT_STATUS_ACCESS_DENIED
SPNEGO login failed: Access denied


So it is probably some bug in libsmbclient. Are you able to connect to the server using smbclient?

smbclient -d 99 //home-nt-svr/john -U john -W HOME
Comment 18 johnf90.964 2016-04-25 12:36:40 UTC
Created attachment 326682 [details]
output of terminal session

Here is the output from the terminal session, still could not see into the files.
Comment 19 Ondrej Holy 2016-04-25 12:53:17 UTC
Thanks again. So it confirms, that the bug is not in GVfs itself, but it is in Samba. Please file a bug report for samba and attach the log:
https://bugzilla.samba.org/

Please add a comment with a link to the new bug report...

Let's close this bug as NOTGNOME, though there was mentioned more issues. Please file a separate bug report if you still see some of those issues...
Comment 21 johnf90.964 2016-04-26 12:09:50 UTC
As requested I opened a bug report at Bugzilla-samba. Incident #11874.
Comment 22 Ondrej Holy 2016-04-27 09:22:39 UTC
(In reply to Debarshi Ray from comment #20)
> Maybe this is related:
> https://bugzilla.redhat.com/show_bug.cgi?id=1327072
> 
> Or, this:
> https://bugzilla.redhat.com/show_bug.cgi?id=1327697

Thanks for the notice, I see those, it might be somehow related, but did not find anything useful there...
Comment 23 Ondrej Holy 2016-04-27 09:22:55 UTC
(In reply to johnf90.964 from comment #21)
> As requested I opened a bug report at Bugzilla-samba. Incident #11874.

Thanks