I have a Linux samba server and have explicitly listed users that can access the folder.

I have successfully congfigured Samba to require a username and password when accessing the share from windows (using the smbpasswd, etc.).

But now I want to force clear the auth cache on the windows machine. Such as when I go to a colleague's computer, I use my account to access a file in the protected share, but then before I leave his computer, i'll want to make sure the authorization cache is cleared so he cannot access that folder with my credentials.

I found the command to use in the windows command prompt on google a couple of weeks ago but silly me I didn't save it...

Hope someone can help, thanks!

Oh, Samba is configured as a workgroup and not a domain (if that helps) - so windows users do NOT log into a domain on start up.

5 Answers 5


How about this:

net session \\samba.server.ip.address /delete

You can also use:

net use

To give a list of active sessions and to ensure that you've deleted them afterwards.

  • 3
    A session does not exist with that computer name. But it exists obviously. Tried both IP and name.
    – tomasb
    Nov 12, 2014 at 13:45
  • 3
    net use \\computername /delete worked to delete it, but the samba credentials were still present, even after restarting explorer from the task manager
    – RyanTM
    Feb 19, 2015 at 19:05

Try this

Control Panel\All Control Panel Items\Credential Manager

Click on the arrow beside the cred you wish to delete

than click on remove from vault

  • 8
    This helped me where the accepted answer did not. Thank you! Jul 1, 2014 at 20:29
  • 1
    Faster way: Win+R and paste %windir%\explorer.exe shell:::{1206F5F1-0569-412C-8FEC-3204630DFB70}
    – droidgren
    Aug 15, 2015 at 8:35
  • 1
    I am still able to delete and write file on my network after doing this. Oct 16, 2018 at 10:54

Incomplete advice. The answer is:

As previously mentioned clear all entries in credentials manager, close any open share explorer windows and/or all applications utilizing the share.


Open services manager. Find the "Workstation" service and restart it.

  • Agreed - this is the correct answer.
    – Ryan Ries
    Nov 4, 2015 at 18:49
  • @endolith Communities are different. It's ok here.
    – Sven
    Sep 27, 2016 at 5:12

How to Disconnect\logout from Samba Share on Windows 10.

RUN cmd as user(not administrator)!!!

watch yours connection

net use

delete all connection(logout)

net use * /delete

net use * /d

net use \\ /delete

delete all saved network passwords

klist purge

or run utilities

control keymgr.dll

or run

rundll32.exe keymgr.dll, KRShowKeyMgr

If deleting credentials from Credential Manager does not help then you have two more options:
1) Open Run and execute rundll32.exe keymgr.dll, KRShowKeyMgr and look for addresses you would like to remove.
2) If CMD's net use does not show anything then open cmd as administrator and execute:

net stop workstation /y
net start workstation

This should clear the cache. Last option always works for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .