Default Ports for Samba

Default Ports for Samba

Tags :

Category : How-to

Get Social!

The ports required by Samba vary depending on if you use Samba as a domain controller or not. The most common type of Samba deployment would be to use a non domain controller deployment of Samba to create file shares for an existing domain or workgroup.

All of the below ports are TCP:

  • 137 (netbios-ns) – is used for the NETBIOS name service
  • 138 (netbios-dgm) – is used for the NETBIOS datagram service
  • 139 (netbios-ssn) – is used for the NETBIOS session service
  • 445 (microsoft-ds) – is required if you are using Microsoft Active Directory

Samba: The process cannot access the file because another process has locked a portion of the file

Tags :

Category : How-to

Get Social!

Copy file error on samba share over nfsI had a problem with a SMB share which was sharing storage from an NFS mount.

Whilst you could argue that it is not efficient to share storage this way, sometimes there is a valid need.

The error was displayed when creating a none empty file, or copying a non zero byte file to the storage. The error is displayed, in my case in Windows, in a dialogue box.

Error:

The process cannot access the file because another process has locked a portion of the file

To fix this issue we need to open the smb.conf file on the Samba server

vi /etc/samba/smb.conf

In the general section of the smb.conf (that is usually the part at the top of the file) add “strict locking = no“. An example of how your smb.conf file may look is below.

[global]
    netbios name = sambaserver
    workgroup = JAMESCOYLE
    security = user
    encrypt passwords = yes
	strict locking = no

[homes]
    comment = %u's Home Directory
    browsable = no
    read only = no

When strict locking is disabled, the NFS server will only lock the file when the client tells it to. When it is enabled, the NFS server locks the file on every read and write.


Visit our advertisers

Quick Poll

Which type of virtualisation do you use?
  • Add your answer

Visit our advertisers