Compiling Common Programs
- Kernel
- SSH
- IPTables
-
Kernel
This section details what to add to your kernel to allow for iptables to be used. Iptables is only able to be used on a 2.4.x kernel or later. Note: To build a kernel, a user must become root. The kernel will not build for a normal user.
- Obtain the kernel in either tar.bz2 or tar.gz format from the kernel home page. Move the kernel into the /usr/src/ directory from the current directory by entering mv linux-2.4.x.tar.yyy /usr/src/ where y is either bz2 or gz.
-
- Change directories to /usr/src/ and run one of the following commands:
- For tar.bz2: bunzip2 linux-2.4.x.tar.bz2 and then tar -xf linux-2.4.x.tar
- For tar.gz: tar xfz linux-2.4.x.tar.gz
- Change to the linuxXYZ (XYZ is only reference, the kernel (depending on version) untars in many different folders) directory. To configure the kernel, you can either run make menuconfig or make xconfig. For the menuconfig option, you must have ncurses5 development installed. For the xconfig option, you must have tcl and tk installed.
- Under Networking Options add the Network Packet Filtering by highlighting it and hitting "y".
- Find the IP:Netfilter Configuration menu and navigate into it. Add all the options underneath this menu by highlighting each one and hitting the "y" key.
- Add all other parts of the kernel that you require.
- Save the current configuration by backing all the way out of the configuration. Then, run make dep clean bzImage modules modules_install install.
- Sit back and wait for the kernel to build. When it finishes, enter yes to running lilo. Reboot.
- Congratulations, you have now added the required kernel source to use iptables. Now continue to the iptables compile.
SSH
Compiling commercial SSH is quite an easy task. Unless you have specific known needs, you will only need to use the default options. If you should have problems, consult either the ssh home page or consult the Faculty Support Group.
- Obtain the source for ssh.
-
- Save the tarred file in the /usr/src/ directory. Untar the source by using the command tar -xfz file.
- Once it is done unpacking, navigate to the ssh folder.
- Use the command ./configure to configure ssh. If there are any options that you need to add, do so now, otherwise this default option should work.
- After the configure is done, run make to compile the source. This may take a while depending on the computer.
- Finally, run make install to install the ssh client.
- If you would like to ssh to the machine, you will have to either create a script to run the ssh server (sshd/sshd2) or start the server manually every time the computer reboots or if the server stops.
IPTables
Compiling and installing iptables is very simple. There are no options that need to be set, and no special place to point the install to. The following few steps detail how to install iptables. Keep in mind that the options in the kernel must be present for iptables to work.
- Download the source code from IPTable's Home Page.
-
- Copy the file into the /usr/src/ directory and unpack it by running the following commands: bunzip2 filename.tar.bz2; tar -xf filename.tar.
- By unpacking, the new directory should have been created named iptables-1.2.X. Enter the directory.
- As root, type make and press enter. After this is done, type make install and press enter.
- Congratulations, if you have not come up with any errors IPTables has been successfully installed.
- To check whether the rules you added in the script were really added, become root and type iptables -L. This will list the rules that iptables is monitoring.
should be closed.
If you have multiple links one after another, they need to be seperated by more than white space
if you have a list of links use:
this will indent the list but the bullet is white so it won't show up.
-->
should be closed.
If you have multiple links one after another, they need to be seperated by more than white space
if you have a list of links use:
this will indent the list but the bullet is white so it won't show up.
-->