Pages

Thursday, January 29, 2015

Samba Error Multiple connections to a server or shared resource by same user, ..

How to fix samba error on windows client :
"Multiple connections to a server or shared resource by same user, using more than one username, are not allowed. Disconnect all previous connections to the server or shared resource and try again"

Solution
Windows by default stores a cache of all the network drives accessed so that next time when you try to access the same path it will take the credentials from the cache without prompting for username/password again.


In such cases you need to clear the cache. 

How do we do that?
Go to your windows machine and open the cmd prompt

C:\Users\Deepak>net use
New connections will be remembered.
Status       Local     Remote                    Network
-------------------------------------------------------------------------------
OK                     \\192.9.18.6\common        Microsoft Windows Network
The command completed successfully.


As you see above a single cache entry is there in my windows machine for //192.9.18.6, so next time if I try to access this share with some other username/password, I would get the same error.

So we will have to clear this cache

C:\Users\Deepak>net use /delete \\192.168.0.100\IPC$
\\192.168.0.100\IPC$ was deleted successfully.

C:\Users\Deepak>net use
New connections will be remembered.

There are no entries in the list.


or 

If you are using active directory, you can add script ".bat"  on your server for automatically mapping.
add netlogon samba : /var/lib/samba/netlogon/name_logon.bat

with value of file .bat like this  :

net time \\192.9.18.6 /set /yes
net use m: /delete /y
net use m: \\192.9.18.6\common








1 comment: