Ubuntu

Gvfs keeps asking for password when trying to mount Samba share

Reported by eddified on 2010-01-20
230
This bug affects 58 people
Affects Status Importance Assigned to Milestone
gvfs
New
Medium
gvfs (Ubuntu)
Medium
Unassigned
Declined for Lucid by Sebastien Bacher
Declined for Maverick by Sebastien Bacher

Bug Description

Binary package hint: nautilus

My Ubuntu Desktop (9.10, 64-bit) VM can't connect to my Windows 7 (64-bit, Ultimate) File Share using Nautilus. I enter "smb://<comuterName>" in the address bar and then it comes up with a password dialog (see screenshot) and then after entering the correct login info, the dialog disappears for a second or two but then reappears again. The dialog always comes back up and the share is never mounted.

    * Connecting from an XP box on the network to the windows 7 share works just fine.
    * Connecting from the Ubuntu machine to the windows 7 share using the appropriate 'smbmount' command works just fine.
    * Connecting from the Ubuntu machine (using the nautilus GUI) to the XP box (password protected) works just fine.
    * Then I turned off password protection in Win7, rebooted the win7 machine, and still all of the above tests turned out the same. And the Ubuntu machine still doesn't connect to the windows share using the nautilus GUI, and still displays the password dialog even though no password is required anymore.
    * I tried using smbclient to view the shares, here is the output (not sure if I should be trying something else using the smbclient program):
          o eddie@eddie-ubuntu:~$ smbclient -L eddie-win7
            Enter eddie's password:
            session setup failed: SUCCESS - 0

ProblemType: Bug
Architecture: amd64
Date: Sun Jan 17 15:41:28 2010
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/nautilus
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
Package: nautilus 1:2.28.1-0ubuntu3
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-17.54-server
SourcePackage: nautilus
Uname: Linux 2.6.31-17-server x86_64

eddified (eddie-bishop) wrote :
eddified (eddie-bishop) wrote :

Screenshot attached.

Pedro Villavicencio (pedro) wrote :

gvfs-mount location works fine?

Changed in nautilus (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
eddified (eddie-bishop) wrote :

These work:
sudo mount -t cifs '\\192.168.15.101\code' /home/eddie/code -o username=eddie,password=password
sudo smbmount '\\192.168.15.101\code' /home/eddie/code -o username=eddie,password=password

So does this line in /etc/fstab:
//192.168.15.101/code /home/eddie/code smbfs username=eddie,password=password,uid=eddie,gid=eddie 0 0

However, gvfs-mount doesn't. It keeps asking for my password over and over, even when the share is setup to not use a password.

eddie@eddie-ubuntu:~$ gvfs-mount 'smb://192.168.15.101/code'
Password required for share code on 192.168.15.101
User [eddie]:
Domain [WORKGROUP]:
Password:
Password required for share code on 192.168.15.101
User [eddie]:
Domain [WORKGROUP]:
Password:
Password required for share code on 192.168.15.101
User [eddie]:
Domain [WORKGROUP]:
Password:

Pedro Villavicencio (pedro) wrote :

gvfs issue then, moving it.

affects: nautilus (Ubuntu) → gvfs (Ubuntu)
Changed in gvfs (Ubuntu):
status: Incomplete → New
FakeJake93 (jkt-1215) wrote :

I'm having the same sort of problem. I'm relatively new to Linux; I just downloaded Ubuntu 9.10 about a week ago and moved from Windows XP.

I have a wireless network I was able to connect to just fine elsewhere; I just went into the file manager; clicked Network; Windows Network; and was able to access the files. However, on my home network, I am trying to connect to my old XP computer (file sharing is already enabled on it), and Ubuntu is able to find the Windows Network. When I open it and see "DarkShadow1215" (the name of the computer), clicking on it gives me the password prompt, and everytime I type in my Ubuntu password, it goes away and returns a few seconds later. I've tried everything, from ubuntu-username/ubuntu-password, windows-username/windows-password, ubuntu-computer-name/ubuntu-username/ubuntu-password, windows-computer-name/windows-username/windows-password, and then just the passwords by themselves. There is no error message, no anything. Just the prompt constantly returning as if I haven't entered in the correct password. The windows computers are able to share with each other, it just seems that my ubuntu netbook does not want to connect.

summary: - win7 file share won't mount using nautilus
+ Gvfs keeps asking for password when trying to mount Samba share
Stephen Cradock (s-cradock) wrote :

Well, I hope that this is now correctly identified as a gvfs problem; it has been most disheartening to see it pushed aside repeatedly and always rated as low importance (see the original bug report, #490201 - not a samba bug, must be nautilus, send it upstream, gnome accepts it as one of three hundred low-importance nautilus bugs, so it disappears into a heap of stuff that will never be fixed.)

All the symptoms are clear and reproducible, so when can we have this fixed? It is NOT of low importance - if you are using networking between computers this is a clear and compelling reason not to use Ubuntu.........

bozackt (bozackt) wrote :

I agree with Stephen. This is *not* a low importance bug. Things like this are exactly what keeps Linux/Ubuntu from being widely adopted. Linux needs to play effortless with Windows, but this is a show stopper. It needs to be fixed.

FakeJake93 (jkt-1215) wrote :

Well, I completely agree with Stephen and bozackt here.

I never ended up getting around the bug, so I resorted to fairying files over with a four gigabyte SD card. It wasn't all that painful, but not nearly as painless as dragging the files over the network. >_>

Marco Rodrigues (gothicx) wrote :

I got this problem on 9.10 and still the same at 10.4 LTS, so this should be fixed asap.

It mounts fine with 'sudo mount -t cifs //192.168.1.11/stuff /home/kmos/x -o username=kmos'

Changed in gvfs (Ubuntu):
status: New → Confirmed

Same problem here, and this should have a higher importance.

Also, encountering the same problem with samba shares between Ubuntu only computers(no windows involved).

PostScript (postscript) wrote :

I agree with Stephen and boxackt. This is an extremely (to say the least) annoying bug, and should not be of low importance.

Marco, I tried your fix and it didn't work for me... no idea why.

As a side note, perhaps this does not have anything to do with the discussion, but I am unable to access the same server using RDC through Terminal Server Client. Although this is a different bug, it seems related because it does not accept my username and password.

Another theory I have is that usernames with spaces trigger this bug - did any of you access your shares with Windows usernames containing spaces?

Sebastien Bacher (seb128) wrote :

The issue is an upstream one and it would be nice if somebody having it could send the bug the to the people writting the software (https://wiki.ubuntu.com/Bugs/Upstream/GNOME)

Richard Garvin (garvinrick4) wrote :

This is what we used at one time to fix this problem.
Easy enough to try.

gksudo gedit /etc/samba/smb.conf

Find this section in the file:
####### Authentication #######
# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
#security = user

Uncomment the security line, and add another line to make it look like this:
security = user
username map = /etc/samba/smbusers
__________________

Richard Garvin (garvinrick4) wrote :

All Windows machines have to have log-in password for workgroup to
work.

Marco Rodrigues (gothicx) wrote :

I remember this bug didn't happen at Ubuntu 9.04 (Jaunty). So this is a regression..

Changed in gvfs:
status: Unknown → New
Nythain (nythain) wrote :

Still haven't found a fix for this problem, and its "low" priority is convincing me to distributions. You know the greatest fix for this I've found so far, run an effing windows xp or 7 install in a virtual machine. This is ridiculous.

Changed in gvfs (Ubuntu):
status: Confirmed → Triaged
Changed in gvfs (Ubuntu):
importance: Low → Medium
tgra (thomas-grande) wrote :

The same issue here! Do anybody have a fix?

best regards
Thomas

James Pakko (james-pakko) wrote :

I had this problem and this is what fixed it for me:

in the [global] section of /etc/samba/smb.conf put in these lines:
   name resolve order = lmhosts bcast host wins
   lanman auth = yes
   client lanman auth = yes
   client plaintext auth = yes

Good luck!

Marco Rodrigues (gothicx) wrote :

It didn't worked for me :/

Xenomorph (xenomorph) wrote :

This doesn't work in 9.10, 10.04, or 10.10.

How could this slip by testers? No one uses Windows?

eddified (eddie-bishop) wrote :

@Xenomorph: Either that, or the ones that do use windows (like me) give up on Linux and move back to Windows. Don't worry, I try linux again every few couple of years, I haven't completely given up on it. :)

Changed in gvfs:
importance: Unknown → Medium
George DeKatt (georgedekatt) wrote :

This has not worked from 9.04 to 10.10
I have to resort to mounting the share in /etc/fstab

Linux sandbox 2.6.35-23-generic #36-Ubuntu SMP Tue Oct 26 17:03:18 UTC 2010 i686 GNU/Linux

Juris (jurispv) wrote :

I've tried everything but the thing that worked for me was setting correct hostname in /etc/hostname and /etc/hosts. Mounting works like a charm after reboot.

I have the same annoying problem on 9.10

Karl Kropf (ksk-clara) wrote :

For what it's worth, I experienced this problem trying to set up a two-way share with a Windows 7 machine. I'm running Ubuntu Studio 10.04. I installed samba (via the Software Centre) and could see the machine in Places>Network but all I could see when double clicking on the icon for the machine was ADMIN$ and C$. Double clicking on either of these brought up the password pop-up and the attendant problems above. To cut a longish story short, I went here:

https://help.ubuntu.com/community/Samba/SambaClientGuide

and found out that the standard 'Software Centre' install of samba (on my machine) did not include 'nautilus-share' (I had no trouble getting access to the machine from the Windows client). I installed nautilus-share and tried again. This time opening the machine on Places>Network I could see ADMIN$, C$ and Users. Double clicking on the Users folder brings up the password pop-up which works fine - I have access to that directory and all its contents (even though some have the lock icon. Trying to open either of the other directories does not work, however (same problem). One quirk is that the pop-up comes up twice, even if you cancel.

Hope this is of some use.

Mårten Woxberg (maxmc) wrote :

I just installed the desktop version of Ubuntu 11.10 on my 2nd computer.

Right after the install I tried to access the samba shares (my main purpouse for installing ubuntu).
I have two computers who share and both of them was listed as computers in Nautilus.
Nautilus did not however list my router with USB that also shares through samba.

One of the machines runs Openelec (linux dist) and I could access that by doubleclicking it and I saw it's shared folders.
I could also navigate into windows shares but I could not access my workgroup there.

So I upgraded all of the packets after installation (245) and now after reboot it asks me for password every time I try to access the workgroup. It works fine if I actually write the path to the machine and the folder, no problems no password. But if I want to list it then I have the same problem as everyone else.
Also now the only machine I could access the shares from asks for SSH-login instead in nautilus...
As you can see from my smb.conf I have tried alot of the things in this thread and it won't work.

mawox@woxnet-nas:/etc/samba$ testparm -s
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE
[global]
 workgroup = WOXNET
 server string = %h server (Samba, Ubuntu)
 map to guest = Bad User
 obey pam restrictions = Yes
 pam password change = Yes
 passwd program = /usr/bin/passwd %u
 passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
 username map = /etc/samba/smbusers
 unix password sync = Yes
 lanman auth = Yes
 client lanman auth = Yes
 client plaintext auth = Yes
 syslog = 0
 log file = /var/log/samba/log.%m
 max log size = 1000
 name resolve order = lmhosts host wins bcast
 dns proxy = No
 wins server = 192.168.1.1
 usershare allow guests = Yes
 panic action = /usr/share/samba/panic-action %d

[printers]
 comment = All Printers
 path = /var/spool/samba
 create mask = 0700
 printable = Yes
 browseable = No

[print$]
 comment = Printer Drivers
 path = /var/lib/samba/printers
mawox@woxnet-nas:/etc/samba$

Thomas M Steenholdt (tmus) wrote :

I have this exact problem on a freshly installed Precise.

This is what I had to do, to fix the problem:

in /etc/samba/smb.conf add the following to the bottom of the [global] section:

client lanman auth = yes
client ntlmv2 auth = no

I could gvfs-mount a Windows 2008 share, but not an Alfresco CIFS share. With the above changes to smb.conf, I can access all shares withoput problems.

I didn't have this problem on a freshly installed Oneiric machine, so I'm not sure what's changed og wether thes should be fixed in gvfs or in the default samba installation.

Alexandre Jodoin (cacalex) wrote :

12.04 here...

This issue is still present...
Let me know if you need more info...

auth.log doesn't show errors...

Matthew Meyer (osarusan) wrote :

Same problem here... good grief how long has this been going on with no solution?

I tried each of the fixes listed above, but none of them worked for me. I have to agree with the above sentiments that this is exactly the type of thing that causes people to give up on Ubuntu and stick with Windows permanently. This bug was submitted over 2 years ago, and people are still asking for a solution...

Ulf Tidstrand (ulf-tidstrand) wrote :

The solution in comment #29 worked for me in 12.04. However, one of my accounts still had problems (while other accounts on the same machine worked OK). It turned out that there was a local smb.conf file in the .smb directory of the account's home directory. I simply removed the entire .smb directory and then the global settings in /etc/samba/smb.conf had effect.

I guess you can enter the settings in comment #29 to the local file as well, but I have not tried that...

bnw (1i1g6) wrote :

The solution in #29 fixed it for my 12.04 as well.

icb410 (ian-berke) wrote :

Solution in #29 fixed it for me. I already had the client lanman auth = yes from 11.10 to get it to work. It was the ntlmv2 line that was needed for 12.04. I am connecting to a netgear Nv+ NAS.

Nhorning (neilhorning) wrote :

Medium is not high enough priority for this bug. If the solution in #29 works for everybody, can't it be fixed downstream by adjusting the default settings for smb.conf? It's great that there's a fix, but asking users in a remote location to modify this setting on each one of their machines is obviously not ideal.

The deprecated LanMan authentication is not safe at all. That for it is just a bad workaround to set
client lanman auth = yes
client ntlmv2 auth = no
I hope there will soon be an other solution for this problem!

Jorma (jtl) wrote :

I have two 12.04 machines, one of which was not able to connect to a shared folder in the other.

The problem was solved when on the server side I added myself as one of the users of Samba
(I of course already had a user account on the server):

smbpasswd -a myUsername

I also gave the password that I already was using.

There was no need to restart:

service smb restart

The connection started to work in a minute or two.

More information: http://www.cyberciti.biz/faq/adding-a-user-to-a-samba-smb-share/

------
https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/510059?comments=all

rhhoek (r-h-hoek) wrote :

With changing (adding) /etc/samba/smb.conf to:

client lanman auth = no
client ntlmv2 auth = no
client ntlm = yes

this works for me, like work around #29

Nicolas Krzywinski (nsk7even) wrote :

Hi guys, for me only this line helped:
client ntlmv2 auth = no

The SMB server I am accessing is an old NAS which don't support NTLMv2. We had the same issues on all Windows 7 and Windows Server 2008 machines when trying to access the NAS, because the next gen windows systems have NTLMv1 disabled by default.

So the problem seems to be that gvfs in Ubuntu 12.04 does not try other authentication mechanisms if NTLMv2 is enabled!?

For now this workaround to disable NTLMv2 is no problem, because of the lack of any important NTLMv2 share. But gvfs has to support access to heterogenous samba network environments!

asheenlevrai (asheenlevrai) wrote :

+1

Running Ubuntu 13.04 here and experiencing the same issue.
gvfs can connect flawlessly to shares supporting NTLMv2 but cannot connect to shares supporting NTLM only

The same behavior is observed in Win7 and OSX 10.7 but there are settings that can be modified to add back support for NTLM authentication.

asheenlevrai (asheenlevrai) wrote :

Solved problem using this:

Edit /etc/samba/smb.conf

add the following in the [global] section

client ntlm auth = yes
client ntlmv2 auth= no

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.