ComTech: IT Support Stirling
TwitterFacebookGoogle

How to share files on Debian Wheezy


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:

workgroup=Home_Network01

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:

testparm

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

P1020114

Hi I’m Chris Wakefield the owner of ComTech IT Support. I provide Windows, Mac and Linux based IT Support to small businesses in Stirling, Alloa and Falkirk.

Follow @Comtech247 on Twitter

 

 

How to set up a DNS server on Debian Wheezy


Debian makes a fantastic server.  It is stable and very rarely goes down so today I will show you how to turn it into a DNS server.  For this tutorial I will be using Debian Wheezy as my base system.

On your server open up a terminal and  install the bind9 package by typing:

sudo apt-get install bind9

There are four configuration files we will need to configure so lets take the first.  In your terminal type:

sudo nano /etc/bind/named.conf.local

and replace nano with your favourite text editor.

Within the file insert the following code:

————————————————————————————————————————

# This is the zone definition. replace example.com with your domain name
zone “comtech.com” {
type master;
file “/etc/bind/zones/comtech.com.db”;
};

# This is the zone definition for reverse DNS. replace 0.0.10 with your network address in reverse notation – e.g my network address is 0.0.10
zone “0.0.10.in-addr.arpa” {
type master;
file “/etc/bind/zones/rev.0.0.10.in-addr.arpa”;
};

———————————————————————————————————————

Instead if using comtech.com choose your own DNS domain (this is not the same as an active directory domain but rather a name for your DNS zone).

WORD OF WARNING

Make sure the ” marks above are vertical and not curved.  If they are curved you will get errors when you come to restart the bind 9 package (trust me I have done that a couple of times!!)

Now we need to configure the next file.  In your terminal type:

sudo nano /etc/bind/named.conf.options

You will need to adjust the forwarders with the address of your ISP’s DNS servers (the example below shows BT’s DNS servers). Modify the file accordingly.

———————————————————————————————————————

forwarders {

62.6.40.178;
62.6.40.162;
};

———————————————————————————————————————

Next up is the zones file so in your terminal type:

sudo mkdir /etc/bind/zones

Now we need to configure it by typing:

sudo nano /etc/bind/zones/comtech.com.db (replace comtech.com with your DNS domain).

Add the following code to the file:

————————————————————————————————————————

// replace example.com with your domain name. do not forget the . after the domain name!
// Also, replace ns1 with the name of your DNS server
comtech.com. IN SOA HomeServer01.comtech.com.
// Do not modify the following lines!
2006081401
28800
3600
604800
38400

)

// Replace the following line as necessary:
// ns1 = DNS Server name
// mta = mail server name
// example.com = domain name
comtech.com. IN NS HomeServer01.comtech.com.
comtech.com. IN MX 10 mta.example.com.

// Replace the IP address with the right IP addresses.
www IN A 10.0.0.1
mta IN A 10.0.0.3
HomeServer01 IN A 10.0.0.1

———————————————————————————————————————

In the above code replace the following:

comtech.com with your DNS domain name,

10.0.0.1 with your static DNS server address,

HomeServer01.comtech.com with your computers hostname.dns-domain,

mta is your mail server (if you have one). If you do modify the IP address to show this.

Now we have to create the reverse DNS zone file so in your terminal type:

sudo nano /etc/bind/zones/rev.0.0.10.in-addr.arpa

and add the following code:

———————————————————————————————————————

//replace example.com with your domain name, ns1 with your DNS server name.
// The number before IN PTR example.com is the machine address of the DNS server
@ IN SOA HomeServer01.comtech.com admin.comtech.com. (
2006081401;
28800;
604800;
604800;
86400
)

IN NS HomeServer01.comtech.com.
1 IN PTR comtech.com

————————————————————————————————————————

With all the files configured we just have to restart bind so in your terminal type:

sudo service bind9 restart

Don’t forget to test your new configuration:

dig comtech.com

If you are unable to restart the bind9 service run the command named -g 53 which will give you a list of any configuration errors as this is usually the case.

About the Author

P1020114

Hi I’m Chris Wakefield the owner of ComTech IT Support. I provide Windows, Mac and Linux based IT Support to small businesses in Stirling, Alloa and Falkirk.

Follow @Comtech247 on Twitter

 

 

CyberChimps
Follow

Get every new post delivered to your Inbox

Join other followers

WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera
WP Like Button Plugin by Free WordPress Templates