I love Debian. It is very stable and works great as a server, especially a file server, so today I will show you how to share files on Debian Wheezy.
Before we do anything you first have to set a static ip address on your server and this tutorial will show you how. Now we need to install some packages. The first one is samba so open up your terminal and type:
sudo apt-get install samba
Next we need the cifs-utils package so again in your terminal type:
sudo apt-get install cifs-utils
Now we need to configure samba and for that we need the smb.conf file. In your terminal type:
sudo nano /etc/samba/smb.conf
I am using nano but you can use any text editor you choose.
Locate the line workgroup=WORKGROUP and modify it to use the name of your network. For example mine would be:
Now we need to add the network share so scroll down to the bottom of the file and add the following text:
[Shared_Files] – This is the name of your network share
path = home/chris/Shared_Files (change this to the location of your network share)
available = yes
browsable = yes
public = yes
writable = yes
comment =shared files
Now save the file and exit.
We now need to add users to the smbpasswd file. Only users specified in this file will be allowed to access your samba shares. In your terminal type:
sudo smbpasswd -a user (where user is the person allowed to access the shares)
Where prompted enter a password for them twice. Please note that for a user to be entered into the smbpasswd file they have to have user accounts on the server itself.
Once that is done we need to restart the samba service so again in your terminal type:
sudo service samba restart
As a final check type:
If there are any configuration errors then testparm will show them to you. If everything is configured correctly you can check the status of your shares by typing:
smbclient -L 10.0.0.1 (where 10.0.0.1 is the ip address of your file server)
All you have to do now is map the drive to your Linux or Windows clients to get access to your files.
About the Author
Follow @Comtech247 on Twitter