Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I need to change the port numbers of samba. Our ISP is blocking the ports 445 and 139. So I need to run samba in a different port. Please help me to do that.

share|improve this question
up vote 3 down vote accepted

Edit smb.conf and find a line like this,

smb ports = 445 139

change this default port to

smb ports = 2222 2000

Then restart samba server. Now samba server should be listening on the new ports that you have mentioned.

For more info on customizing samba server click here for documentation.

N.B. : Use port number above 1024 as these are reserved for system purpose. Hope it helps!

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.