

Users can access their Samba shares through file managers, terminal commands, and other services that communicate over SMB.The Samba is a “server software” for Linux (and other Unix-based systems) that allows management and sharing of resources in networks formed by computers running Windows. Thus, it is possible to use Linux as file server, print server, etc., such as if the network uses Windows servers (NT, 2000, XP, Server 2003). This article makes an approach to introductory Samba, showing their main characteristics and a little bit of its history. You can test it using the smbclient command: $ smbclient -L //sambaserver Samba is now serving sambashare to any authenticated user. To load in the new configuration, restart Samba: $ sudo systemctl restart mb You must also set a dedicated Samba password: $ sudo smbpasswd -a tux For instance, run the following command to create a group of staff members who need access to the server: $ sudo groupadd staffĪssuming you need to add a staff member named tux to your Samba server, the process is initially the same as usual: $ sudo adduser -g staff \ You can also use standard Unix groups to manage access. Users logging into a Samba share must either have accounts on the server or log in as a guest. You can test your Samba configuration with the testparm command: $ testparm /etc/samba/smb.conf Add users Most users don't need to be aware of this subtlety, but you might see these service names when testing and troubleshooting.


When users access a Samba server, they connect to a service named for one of the bracket sections in the config, such as, ,, and so on.

To create a new share location, add a section to the /etc/samba/smb.conf configuration file with these two definitions: Įach section of this configuration file defines a service. If you don't have DNS configured on your local network, you can use the server's IP address when contacting the Samba server. īy default, your Samba server's NetBIOS name is the server's Linux hostname. If your organization has a specific workgroup structure, then follow that. I have no other existing workgroups on my network, so the workgroup hardly matters for my setup. There's a global section, which defines a workgroup. The default file has several good examples of common options, including provisions for shared printers and home directories. To configure shares and users, edit the /etc/samba/smb.conf file. $ sudo chcon -t samba_share_t /sambashare/ Make sure that your file-share server is accessible over your network by adding the samba service to your firewall config: $ sudo systemctl enable -now firewalldĬreate a directory on the server to hold your shared files and folders, and change the SELinux context to samba_share_t: $ sudo mkdir /sambashare All that's left is a little configuration. Here are the commands: $ systemctl enable -now smb The SMB daemon manages most Samba services, while the NMB daemon provides NetBIOS services. This command also installs the samba-common-tools and samba-libs packages.
#Samba server install#
On your designated Samba server, install the Samba package: $ sudo dnf install samba For client access, Samba is either built into the operating system or easily installed from a repository. It's not difficult to set up, and all you need is at least one server you want to designate as a file-share host (it doesn't have to be rack mounted and could even be a dedicated workstation). It's an essential service to run in organizations that support multiple operating systems, and it's even useful on homogenous networks. It uses the Server Message Block and Common Internet File System (SMB/CIFS) protocol, so the services created by running Samba are available to Linux, macOS, and Windows clients. The Samba project provides file sharing and print services for computers on a network. Get essential IT career advice from IT leaders.Explore training and certification options.
