Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One of our Linux servers (Debian 5) uses Windows shares mounted via cifs.

Each time, when the credentials are changing due to security policy, shares begins to be inaccessible for several hours, or until the Linux machine goes to be completely restarted.

Is there a way to flush the network passwords cache, to avoid this ? Samba restart (/etc/init.d/samba restart) doesn't do anything, the system still uses outdated credentials.

Any help will be appreciated.

share|improve this question

Perhaps mount -oremount /path/to/cifs/share can help?

share|improve this answer

Since mounting a share requires credentials to be supplied, if these credentials change the share must be re-mounted with the new credentials.

You can use -o remount:

mount -t cifs //your/share -o remount,user=youruser,pass=newpass
share|improve this answer
Thanks for the tip. I'm using fstab and credentials are defined in external file via mount.cifs "credentials=" option. Apparently, remount doesn't make the job after modifying credentials. – Fedir Mar 14 '12 at 14:38
up vote 1 down vote accepted

The networks samba drive was mounted via fstab, and the cache apparently kept until the restart.

So I made manual mount and it works flawlessly :

mount -t cifs -o username=user,password=pass\!word //192.168.XX.XX/someshare /mnt/localdir

After this procedure, on my machine the cache was cleared, so I could make umount and mount via the fstab.

Alternatively, the cache is active until server restart, and after the new credentials will be applied via fstab configuration.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.