Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

After connecting to a samba share, then disconnecting, netstat still shows that the ports are ESTABLISHED, even when the clients are on SUSPEND, HIBERNATE, or have SHUTDOWN. Looking over the samba documentation, I know now that I can set a period so those ports can TIMEOUT after said time. But without this variable: How long does the

A) Windows (Win 7 x64 Home) connection (445 shown in my case) take to close?

B) Linux (Ubuntu 11.04 x86) connection (139/445 shown in my case) take to close?

share|improve this question
up vote 0 down vote accepted

To clarify: Before this question, from a pretty much "stock" configuration, I was getting the symptoms shown above. After this question, and some tinkering, I have gotten the time down somehow to disconnect minutes after LOGOUT, ETC.; without the need to resort to the solutions below.

The best, trustworthy, answer I can find is from O'Reilly Online.


This initiates a periodic (four-hour) check to see if the client has disappeared. Expired connections are addressed somewhat better with Samba's keepalive and dead time options. All three eventually arrange to close dead connections, returning unused memory and process-table entries to the operating system.

So basically, it is closed after just 4 hours! But as also said, it's best to use Samba's keepalive option to close this far gap. Of course, even then, since Samba's/Windows's/Etc. ability to close and reopen said ports is of no problem, I will resort to using deadtime instead to just close the unused gap; whether or not the client is still there.

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.