Life in code, apps and OS's

Archive for May 2007

Assumed that “eth0” is the interface for network card

IP Address Range: 192.168.0.100 to 192.168.0.200
Subnet Mask: 255.255.255.0
DNS Servers: 202.188.0.133, 202.188.1.5
Domains: tm.net.my
Gateway Address: 192.168.0.1
sudo apt-get install dhcp3-server 
sudo cp /etc/default/dhcp3-server /etc/default/dhcp3-server_backup 
gksudo gedit /etc/default/dhcp3-server
  • Find this line
... 
INTERFACES=""
  • Replace with the following line
INTERFACES="eth0"
  • Save the edited file
sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf_backup 
gksudo gedit /etc/dhcp3/dhcpd.conf
  • Find this section
... 
# option definitions common to all supported networks... 
option domain-name "example.org"; 
option domain-name-servers ns1.example.org, ns2.example.org;  

default-lease-time 600; 
max-lease-time 7200; 
...
  • Replace with the following lines
# option definitions common to all supported networks... 
#option domain-name "example.org"; 
#option domain-name-servers ns1.example.org, ns2.example.org;  

#default-lease-time 600; 
#max-lease-time 7200;
  • Find this section
... 
# A slightly different configuration for an internal subnet. 
#subnet 10.5.5.0 netmask 255.255.255.224 { 
# range 10.5.5.26 10.5.5.30; 
# option domain-name-servers ns1.internal.example.org; 
# option domain-name "internal.example.org"; 
# option routers 10.5.5.1; 
# option broadcast-address 10.5.5.31; 
# default-lease-time 600; 
# max-lease-time 7200; 
#} 
...
  • Replace with the following lines
# A slightly different configuration for an internal subnet. 
subnet 192.168.0.0 netmask 255.255.255.0 { 
 range 192.168.0.100 192.168.0.200; 
 option domain-name-servers 202.188.0.133, 202.188.1.5; 
 option domain-name "tm.net.my"; 
 option routers 192.168.0.1; 
 option broadcast-address 192.168.0.255; 
 default-lease-time 600; 
 max-lease-time 7200; 
}
  • Save the edited file
sudo /etc/init.d/dhcp3-server restart

Here is a very simple tutorial on how to transform your Ubuntu Server 6.06 LTS into a Windows File Server with a simple web-based configuration system.

This tutorial should work with other Ubuntu Server versions however I tried and tested this on my Ubuntu 6.06 Server.

Firstly you will need to install and configure your Ubuntu Server then use apt-get to install the required software packages.

Firstly log into your Ubuntu Server with the ‘root’ account alternatively use ‘sudo’.

Firstly you will need to uncomment the sources from /etc/apt/source.list

Now execute this command:-

apt-get update

apt-get upgrade

Now you should be able to download and install the packages, at the console type:-

apt-get install samba smbfs swat

Ubuntu will now download and configure Samba (Windows File Sharing for Linux) and SWAT (Samba Web Administrator Tool).

It should now be ready to use, You can navigate to the web-based configuration tool at this URL:-

http://yourdomain:901

You will then need to login with your servers root account. Then you can use SWAT to configure Samba and add/edit shares.

For several months now, I have wanted to setup a fast, secure FTP server so that I myself and users of my server are able to login but can only view and browse there ‘home’ directory.. basically /home/{username}. I have previously tried installing ProFTPd but I have found that to be really slow with clients connecting and transfering data, today I tried installing VSFTPd as it has a history of being really secure and I was shocked to see how fast it was too :). I know for a fact that Novell use VSFTPd on their public web servers.

Ok, so lets get going….

Firstly you will need Ubuntu Server installed, I wrote and tested this tutorial while using Ubuntu Server 6.06 (Dapper Drake) however its pretty simple and should work with other versions of Ubuntu and Debian alike.

Ok so we install VSFTPd by issueing this command at the terminal… (please make sure you are logged in with the root account).

apt-get install vsftpd

Then VSFTPd will be downloaded and installed, next we are going to edit the configuration file to lock users to there home directories, so next we issue this command:-

vi /etc/vsftpd.conf

So now you should look down the configuration file and find this line ‘chroot_local_user=‘ next you should set the value to ‘yes‘ , so the new line should look as follows:-

chroot_local_user=YES

Then you should also make some minor adjustments to the system to enable users to upload and turn anonymous ftp off to stop the general public from accessing your server, The below options are not required but I personally like it set up this way.You can either add the following lines or simply uncomment them by deleteing the ‘#’ at the beginning of the line.

local_enable=YES
This will allow the local machine/server to connect.

write_enable=YES
This will enable users to upload, ammend and delete files.

You will now need to restart the VSFTPd daemon, to do this issue the following command:-

/etc/init.d/vsftpd restart 

Thats it, It should now work fine, I would test it on a remote machine and see if you can connect to the server now. I hope this little tutorial helped.



  • How To Dyndns Ubuntu | Order Goods: […] DynDNS Client Setup on Ubuntu | Life in code, apps and OS’s – May 18, 2008  · 7 Responses to "DynDNS Client Setu
  • lizrandolph10886: Wonderful article! We are linking to this particularly great post on our website.nKeep up the great writing. Click
  • waseem Ahmad: Dear. i have a separate application server and a separate mysql database server. when i want to access the application server to login from the local