In this tutorial, you will learn how to configure and setup samba on a Linux system, giving you the ability to share files and folders with either a Linux or Windows client. In addition to Linux Mint 11, the following steps should also work on other genome-based distributions. The only difference for KDE is how to define shares.
This applies on the Samba server.
The first step is to make sure Samba is Present. Run the following commands in a terminal:
sudo apt-get install smbd
When prompted, type your root password. Type:
sudo apt-get install smbfs
Enter your root password again.
Type the following into your smb.conf file:
gksu gedit /etc/samba/smb.conf
To change the name of your network, locate the line WORKGROUP = WORKGROUP and replace it with the name of your network. As an example, mine would be changed to WORKGROUP = MINT_HOME. Then save and exit.
Adding users to /etc/samba/surpassed is the next step. Users specified in the smbpasswd file will have access to your Samba shares. Run the following command as root:
SMBpasswd -a user (where the user is the user’s name who has access to the shares). Type the new password twice when prompted.
Its compulsion to define samba shares. Format:
Enter your root password when prompted. After adding your samba shares, close the GUI.
To restart Samba after updating the smb. conf file, type:
gksu service smbd restart
We now need to review the configuration so far. Sort:
TestParm will tell you if there are errors in the smb. Conf file. Type this if all is well:
smbclient -L 192.168.1.10 (where 192.168.1.10 is the IP address of your samba server). A list of all shares will be displayed. If there are no errors at this point, your server is properly configured.
Linux Clients: configure and setup samba
Use the package manager or apt-get install to install smbclient and smbfs. Then mount the shared drives. Select the location for the shared drives. /media/dev/share is where I will mount them, but first, I must create the directory dev:
gksu mkdir dev
The new dev directory should appear in media if we run ls. We can now mount the shares.
gksu mount -t smbfs //192.168.1.10/(share name) /media/dev/share
Samba server’s IP address is 192.168.1.10. The share will be mounted, but only if you are logged in. The following line should be added to /etc/fstab to make the link persistent.
//192.168.1.10/(share) /media/dev/share cifs username=user,password=pass,user,rw,noatime 0 0
Windows Clients: configure and setup samba
It is necessary to change the workgroup to MINT_HOME in the host’s file. To do so, you need to add the IP address of the Samba server (open as administrator).
Restart your computer after mapping the shares.
It is best to avoid firewalls. Either disable or add exception rules to ports 137-139 and 445.