<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Article Desktop</title>
	<link>http://www.articledesktop.com</link>
	<description>share new technology, new ideas</description>
	<pubDate>Wed, 26 Dec 2007 15:30:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Setup automatic ssh login on two linux machines</title>
		<link>http://www.articledesktop.com/linux/setup-automatic-ssh-login-on-two-linux-machines/25</link>
		<comments>http://www.articledesktop.com/linux/setup-automatic-ssh-login-on-two-linux-machines/25#comments</comments>
		<pubDate>Tue, 27 Nov 2007 17:25:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.articledesktop.com/linux/setup-automatic-ssh-login-on-two-linux-machines/25</guid>
		<description><![CDATA[This is a simple and proof of concept setup. It shows you how to setup an automatic ssh shell login from one Linux machine to another machine. For detail description the whole concept, you can read man page of ssh and ssh-keygen or search the web.
Scenario:
Imagine you have a Linux machine at home called CLIENT [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple and proof of concept setup. It shows you how to setup an automatic ssh shell login from one Linux machine to another machine. For detail description the whole concept, you can read man page of ssh and ssh-keygen or search the web.</p>
<p><strong>Scenario:</strong><br />
Imagine you have a Linux machine at home called CLIENT and another Linux machine called SERVER at remote location such as your office. From CLIENT, you want to simple run a command ssh username@server that will log you in to SERVER without asking for a password.<br />
CLIENT machine setup    Use the following simple steps to create empty pass phrase public/private key pair.</p>
<ul>
<li>In home directory, login as the user you want to automatically login to remote SERVER.</li>
<li>Run this command: &#8220;ssh-keygen -t dsa&#8221;. When asked for pass phrase and some other information, make sure you just hit ENTER key to accept default value. Default value is empty.</li>
<li>When process finish, two files will be created in ~.ssh/ directory. Usually, they are called id_dsa and id_dsa.pub.</li>
<li>Now, you may need to move these two files out from ~.ssh directory because they may prevent you to ssh or scp file to remote SERVER machine.</li>
<li>Next, scp id_dsa.pub file to remote SERVER machine. Then move id_dsa and id_dsa.pub files back to ~.ssh directory.</li>
<li>That is all you need to do on CLIENT machine.</li>
</ul>
<p><strong><br />
SERVER Setup</strong></p>
<ul>
<li>Login as the user to SERVER machine. You should have a file you scp from CLIENT machine call &#8220;id_dsa.pub&#8221;.</li>
<li>Go to ~.ssh directory. Look for a file called &#8220;authorized_keys&#8221;. If it is not there, you can create one using touch command: touch authorized_keys. Some documentations I read mention create the file of authorized_keys2 will also work.</li>
<li>Now, copy the content of id_dsa.pub into authorized_keys and save authorized_keys file.</li>
<li>Now you can test to ssh from CLIENT machine to SERVER. You should be able to login to SERVER without typing a password.</li>
</ul>
<p><em>Some notes</em></p>
<p>If it does not work for some reasons, do the following.</p>
<ul>
<li>Check the file owner of id_dsa.pub. It must be created by the owner of the account, not root. This is true on both CLIENT and SERVER machines.</li>
<li>Make sure content in authorized_keys file does not have empty lines at the beginning or the end of the file.</li>
<li>Sometimes, copy by highlighting in shell does not work properly. You may use read command to read id_dsa.pub file into authorized_keys from vi.</li>
<li>You can choose dsa or rsa encryption algorithm for public/private key pair.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.articledesktop.com/linux/setup-automatic-ssh-login-on-two-linux-machines/25/feed</wfw:commentRss>
		</item>
		<item>
		<title>how to use squid proxy as transparent mode</title>
		<link>http://www.articledesktop.com/linux/how-to-use-squid-proxy-as-transparent-mode/24</link>
		<comments>http://www.articledesktop.com/linux/how-to-use-squid-proxy-as-transparent-mode/24#comments</comments>
		<pubDate>Sun, 15 Apr 2007 16:09:49 +0000</pubDate>
		<dc:creator>vishal</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.articledesktop.com/uncategorized/how-to-use-squid-proxy-as-transparent-mode/24</guid>
		<description><![CDATA[in transparent squid ne need to configure browser to perticular port like 8080 and 3128.
in this mode first edit your squid.conf file
by typing in terminal
vim /etc/squid/squid.conf
edit line  may be 89 in 2.6 version
http_port 192.168.0.1:3128 transparent
( where 192.168.0.1 is your local interface address )
and set visible_hostname to localhost
and insert below lines under tag
# INSERT YOUR [...]]]></description>
			<content:encoded><![CDATA[<p>in transparent squid ne need to configure browser to perticular port like 8080 and 3128.</p>
<p>in this mode first edit your squid.conf file</p>
<p>by typing in terminal</p>
<p>vim /etc/squid/squid.conf</p>
<p>edit line  may be 89 in 2.6 version</p>
<p>http_port 192.168.0.1:3128 transparent</p>
<p>( where 192.168.0.1 is your local interface address )</p>
<p>and set visible_hostname to localhost</p>
<p>and insert below lines under tag<br />
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS</p>
<p>acl our_networks src 192.168.0.0/24 192.168.2.0/24<br />
http_access allow our_networks</p>
<p>(use gedit if not familier with vim )</p>
<p>now start squid by typing</p>
<p>/usr/sbin/squid -z</p>
<p>now  flush all rules of iptabes for transparent mode</p>
<p>iptables -F</p>
<p>iptables -t nat -F</p>
<p>iptables -t mangle -F</p>
<p>now delete this chanis bye</p>
<p>iptables -X</p>
<p>iptables -t nat -X</p>
<p>iptables -t mangle -X</p>
<p>now time to save iptables so type</p>
<p>service iptables save</p>
<p>service iptables restart</p>
<p>now all rules and chains will clear !</p>
<p>check it by /etc/sysconfig/iptables which has all defaults rules set  to accept.</p>
<p>now  /etc/rc.d/rc.local</p>
<p>and insert line</p>
<p>echo ” 1 “&gt; /proc/sys/net/ipv4/ip_forward</p>
<p>and then save and close.</p>
<p>now asuming that your internet interface is eth0 then type :</p>
<p><code> iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128</code></p>
<p>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</p>
<p>service iptables save</p>
<p>service iptables restart</p>
<p>note:- check your service of iptables is set to start during boot up .</p>
<p>or check status of your iptables service</p>
<p>chkconfig –list iptables</p>
<p>if  level 5 is on then its ok othewise start service at level 5 or level 2345.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.articledesktop.com/linux/how-to-use-squid-proxy-as-transparent-mode/24/feed</wfw:commentRss>
		</item>
		<item>
		<title>How to masquerade ( internet connection sharing ) in Linux</title>
		<link>http://www.articledesktop.com/linux/how-to-masquerade-internet-connection-sharing-in-linux/23</link>
		<comments>http://www.articledesktop.com/linux/how-to-masquerade-internet-connection-sharing-in-linux/23#comments</comments>
		<pubDate>Sun, 15 Apr 2007 15:14:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.articledesktop.com/uncategorized/how-to-masquerade-internet-connection-sharing-in-linux/23</guid>
		<description><![CDATA[its very simple to masquerade ( internet connection sharing in window&#8217;s language ) in linux  with few lines of iptables and ip_forward commands.
first of all you have to flush and delete existing firewall rules which are be default bye linux .
so flush rules bye typing in terminal
iptables -F
iptables -t nat -F
iptables -t mangle -F
now [...]]]></description>
			<content:encoded><![CDATA[<p>its very simple to masquerade ( internet connection sharing in window&#8217;s language ) in linux  with few lines of iptables and ip_forward commands.</p>
<p>first of all you have to flush and delete existing firewall rules which are be default bye linux .</p>
<p>so flush rules bye typing in terminal</p>
<p>iptables -F</p>
<p>iptables -t nat -F</p>
<p>iptables -t mangle -F</p>
<p>now delete this chanis bye</p>
<p>iptables -X</p>
<p>iptables -t nat -X</p>
<p>iptables -t mangle -X</p>
<p>now time to save iptables so type</p>
<p>service iptables save</p>
<p>service iptables restart</p>
<p>now all rules and chains will clear !</p>
<p>check it by /etc/sysconfig/iptables which has all defaults rules set  to accept.</p>
<p>now  /etc/rc.d/rc.local</p>
<p>and insert line</p>
<p>echo &#8221; 1 &#8220;&gt; /proc/sys/net/ipv4/ip_forward</p>
<p>and then save and close.</p>
<p>now asuming that your internet interface is eth0 then type :</p>
<p>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</p>
<p>service iptables save</p>
<p>service iptables restart</p>
<p>note:- check your service of iptables is set to start during boot up .</p>
<p>or check status of your iptables service</p>
<p>chkconfig &#8211;list iptables</p>
<p>if  level 5 is on then its ok othewise start service at level 5 or level 2345.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.articledesktop.com/linux/how-to-masquerade-internet-connection-sharing-in-linux/23/feed</wfw:commentRss>
		</item>
		<item>
		<title>How to extract and install a variety of tar application packages</title>
		<link>http://www.articledesktop.com/linux/how-to-extract-and-install-a-variety-of-tar-application-packages/22</link>
		<comments>http://www.articledesktop.com/linux/how-to-extract-and-install-a-variety-of-tar-application-packages/22#comments</comments>
		<pubDate>Tue, 20 Mar 2007 08:16:59 +0000</pubDate>
		<dc:creator>vishal</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.articledesktop.com/uncategorized/how-to-extract-and-install-a-variety-of-tar-application-packages/22</guid>
		<description><![CDATA[Linux/UNIX/FreeBSD contains many tar packages extensions
Probably the most common other type of package you will see are tar files. These come in a few different flavors. You can identify them by their file extensions, which will be “.tar”, “.tar.gz”, “.tgz”, and “.tar.bz2
package extension             [...]]]></description>
			<content:encoded><![CDATA[<p>Linux/UNIX/FreeBSD contains many tar packages extensions</p>
<p>Probably the most common other type of package you will see are tar files. These come in a few different flavors. You can identify them by their file extensions, which will be “.tar”, “.tar.gz”, “.tgz”, and “.tar.bz2</p>
<p>package extension              opening and extraction command</p>
<p>.tar                                                 tar –xvf file.tar</p>
<p>.tar.gz                                             tar -zxvf file.tar.gz</p>
<p>.tgz                                                 tar -zxf file.tar.gz</p>
<p>.tar.bz2 (UNIX, FreeBSD )                    tar xjf file.tar.gz</p>
]]></content:encoded>
			<wfw:commentRss>http://www.articledesktop.com/linux/how-to-extract-and-install-a-variety-of-tar-application-packages/22/feed</wfw:commentRss>
		</item>
		<item>
		<title>How to configure interface from terminal/shell</title>
		<link>http://www.articledesktop.com/linux/how-to-configure-interface-from-terminalshell/21</link>
		<comments>http://www.articledesktop.com/linux/how-to-configure-interface-from-terminalshell/21#comments</comments>
		<pubDate>Tue, 20 Mar 2007 07:36:26 +0000</pubDate>
		<dc:creator>vishal</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.articledesktop.com/uncategorized/how-to-configure-interface-from-terminalshell/21</guid>
		<description><![CDATA[thats the simple ! this is fedora commands so may not working for all linux version
simply type in telnet /ssh terminal or shell terminal
configuring ip address :-
ifconfig eth0  xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
or
ifconfig eth0  xxx.xxx.xxx.xxx/xx (/xx is network bit)
configure gateway :-
route add default gateway xxx.xxx.xxx.xxx
then final if you want to cinfigure DNS address:-
vi /etc/resolv.conf
then add [...]]]></description>
			<content:encoded><![CDATA[<p>thats the simple ! this is fedora commands so may not working for all linux version</p>
<p>simply type in telnet /ssh terminal or shell terminal</p>
<p>configuring ip address :-</p>
<p>ifconfig eth0  xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx</p>
<p>or</p>
<p>ifconfig eth0  xxx.xxx.xxx.xxx/xx (/xx is network bit)</p>
<p>configure gateway :-</p>
<p>route add default gateway xxx.xxx.xxx.xxx</p>
<p>then final if you want to cinfigure DNS address:-</p>
<p>vi /etc/resolv.conf</p>
<p>then add your name server ip</p>
<p align="center">example <img src="http://www.indiforum.themyspacebackgrounds.com/Smileys/default/embarrassed.gif" alt="Embarrassed" border="0" /></p>
<p>ifconfig eth1 172.16.144.3 netmask 255.255.248.0</p>
<p>or</p>
<p>ifconfig eth1 172.16.144.3/21</p>
<p>route add default gateway 172.16.144.1</p>
<p>vi /etc/resolv.conf ( required knowledge of vi editor)</p>
<p>nameserver=172.16.144.1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.articledesktop.com/linux/how-to-configure-interface-from-terminalshell/21/feed</wfw:commentRss>
		</item>
		<item>
		<title>How to read .chm (windows help file most e-book contains this format) in linux</title>
		<link>http://www.articledesktop.com/linux/how-to-read-chm-windows-help-file-most-e-book-contains-this-format-in-linux/20</link>
		<comments>http://www.articledesktop.com/linux/how-to-read-chm-windows-help-file-most-e-book-contains-this-format-in-linux/20#comments</comments>
		<pubDate>Tue, 20 Mar 2007 07:34:43 +0000</pubDate>
		<dc:creator>vishal</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.articledesktop.com/uncategorized/how-to-read-chm-windows-help-file-most-e-book-contains-this-format-in-linux/20</guid>
		<description><![CDATA[you have download many e-books from internet and they are in .chm format (windows help file ) an you are using linux !! then what are you doing ??
most e-books&#8217;s format are .chm (windows help file ) so how to read it in linux because .chm (windows help file) is microsoft proprietary.
just type in terminal [...]]]></description>
			<content:encoded><![CDATA[<p>you have download many e-books from internet and they are in .chm format (windows help file ) an you are using linux !! then what are you doing ??</p>
<p>most e-books&#8217;s format are .chm (windows help file ) so how to read it in linux because .chm (windows help file) is microsoft proprietary.</p>
<p>just type in terminal ( contains internet connection )</p>
<p>for fedora 5 or  6<br />
type yum -y install xchm</p>
<p>then check menu application &#8211;&gt; accessories &#8211;&gt; xchm ( in fedora)</p>
<p>( may not visible in all linux systems )</p>
<p>then check</p>
<p>or run directly in terminal  -<br />
xchm</p>
<p>and pragam will run .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.articledesktop.com/linux/how-to-read-chm-windows-help-file-most-e-book-contains-this-format-in-linux/20/feed</wfw:commentRss>
		</item>
		<item>
		<title>How to play any media -video file in linux using single mediaplayer</title>
		<link>http://www.articledesktop.com/linux/how-to-play-any-media-video-file-in-linux-using-single-mediaplayer/19</link>
		<comments>http://www.articledesktop.com/linux/how-to-play-any-media-video-file-in-linux-using-single-mediaplayer/19#comments</comments>
		<pubDate>Tue, 20 Mar 2007 07:32:34 +0000</pubDate>
		<dc:creator>vishal</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.articledesktop.com/linux/how-to-play-any-media-video-file-in-linux-using-single-mediaplayer/19</guid>
		<description><![CDATA[hi
in windows we have to use many players like real player for -.rm .ram files, quicktime for .mov .3gpp files , divx player for divx files and mediaplayer for .wmv ,avi and flvplayer for .flv files,,, linux has simple solutions for play  all files in single player called mplayer thats award winning software of [...]]]></description>
			<content:encoded><![CDATA[<p>hi</p>
<p>in windows we have to use many players like real player for -.rm .ram files, quicktime for .mov .3gpp files , divx player for divx files and mediaplayer for .wmv ,avi and flvplayer for .flv files,,, linux has simple solutions for play  all files in single player called mplayer thats award winning software of unix and now also launch for windows.</p>
<p>how to use this beautiful software ;-<br />
method is somehow complicated  but gone through proper method it will work without crash.<br />
but small problem there u have to install latest libcgg , libgcc-common platform if you are using fedora distribution then no prob.</p>
<p>download</p>
<p><a href="http://www.mplayerhq.hu/design7/dload.html">http://www.mplayerhq.hu/design7/dload.html</a></p>
<p>binary package and use websites documentation for install generally after tar ./configure &#8211;&gt; make &#8211;&gt; make install method.</p>
<p>then download binary codecs from same websites in download section for linux x86 platform and create one directory named codecs<br />
in /usr/local/lib/  and copy all codecs in /usr/local/lib/codecs.<br />
so your codes platform will be create .</p>
<p>now type in terminal</p>
<p>/usr/local/bin/mplayer -vo x11 <strong><em>file.wmv (or any file path )</em></strong></p>
<p>all file will be run superb .</p>
<p>remember codecs&#8217;s placement is most important conform that codecs path is /usr/local/lib/codecs directory .</p>
<p>if you configure some frontend tool for mplayer for controling( seek drag etc)  mediaplayer menu then use xmms (linux media player ).</p>
<p>if not already installed then</p>
<p>type</p>
<p>yum -t install xmms</p>
<p>after installing download XMMS MPlayer Input Plugin from <a href="http://xmmsmplayer.sourceforge.net/">http://xmmsmplayer.sourceforge.net</a>.</p>
<p>then install xmmsmplayer&#8217;s rpm package.</p>
<p>now start xmms by type xmms in terminal</p>
<p>then rightclick any where on player and go to&#8211;&gt;  option and &#8211;&gt; preference .<br />
and  from i/o plugins select mplayer plugins from xmms.<br />
and click on configure tab and then extra then type <strong><em>-vo x11</em></strong></p>
<p>now select any file from xmms ( look like winamp ) and play file .</p>
<p>note; try to play without configure pluggins of xmms if not work then use -vo x11 option .and you have to go through axact method described above.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.articledesktop.com/linux/how-to-play-any-media-video-file-in-linux-using-single-mediaplayer/19/feed</wfw:commentRss>
		</item>
		<item>
		<title>Learn linux firewall using iptables</title>
		<link>http://www.articledesktop.com/linux/learn-linux-firewall-using-iptables/18</link>
		<comments>http://www.articledesktop.com/linux/learn-linux-firewall-using-iptables/18#comments</comments>
		<pubDate>Tue, 20 Mar 2007 07:28:03 +0000</pubDate>
		<dc:creator>vishal</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.articledesktop.com/uncategorized/learn-linux-firewall-using-iptables/18</guid>
		<description><![CDATA[linux firewall known in the world for its security !! want to learn something about that !!
&#8216;m sure many of you have been wondering how to use iptables to set up a basic firewall. I was wondering the same thing for a long time until I recently figured it out. I&#8217;ll try to explain the [...]]]></description>
			<content:encoded><![CDATA[<p>linux firewall known in the world for its security !! want to learn something about that !!<br />
&#8216;m sure many of you have been wondering how to use iptables to set up a basic firewall. I was wondering the same thing for a long time until I recently figured it out. I&#8217;ll try to explain the basics to at least get you started.</p>
<p>First you need to know how the firewall treats packets leaving, entering, or passing through your computer. Basically there is a chain for each of these. Any packet entering your computer goes through the INPUT chain. Any packet that your computer sends out to the network goes through the OUTPUT chain. Any packet that your computer picks up on one network and sends to another goes through the FORWARD chain. The chains are half of the logic behind iptables themselves.</p>
<p>Now the way that iptables works is that you set up certain rules in each of these chains that decide what happens to packets of data that pass through them. For instance, if your computer was to send out a packet to <a href="http://www.yahoo.com/">www.yahoo.com</a> to request an HTML page, it would first pass through the OUTPUT chain. The kernel would look through the rules in the chain and see if any of them match. The first one that matches will decide the outcome of that packet. If none of the rules match, then the policy of the whole chain will be the final decision maker. Then whatever reply Yahoo! sent back would pass through the INPUT chain. It&#8217;s no more complicated than that.</p>
<p>Now that we have the basics out of the way, we can start working on putting all this to practical use. There are a lot of different letters to memorize when using iptables and you&#8217;ll probably have to peek at the man page often to remind yourself of a certain one. Now let&#8217;s start with manipulation of certain IP addresses. Suppose you wanted to block all packets coming from 200.200.200.1. First of all, -s is used to specify a source IP or DNS name. So from that, to refer to traffic coming from this address, we&#8217;d use this:</p>
<p>iptables -s 200.200.200.1</p>
<p>But that doesn&#8217;t tell what to do with the packets. The -j option is used to specify what happens to the packet. The most common three are ACCEPT, DENY, and DROP. Now you can probably figure out what ACCEPT does and it&#8217;s not what we want. DENY sends a message back that this computer isn&#8217;t accepting connections. DROP just totally ignores the packet. If we&#8217;re really suspicious about this certain IP address, we&#8217;d probably prefer DROP over DENY. So here is the command with the result:</p>
<p>iptables -s 200.200.200.1 -j DROP</p>
<p>But the computer still won&#8217;t understand this. There&#8217;s one more thing we need to add and that&#8217;s which chain it goes on. You use -A for this. It just appends the rule to the end of whichever chain you specify. Since we want to keep the computer from talking to us, we&#8217;d put it on INPUT. So here&#8217;s the entire command:</p>
<p>iptables -A INPUT -s 200.200.200.1 -j DROP</p>
<p>This single command would ignore everything coming from 200.200.200.1 (with exceptions, but we&#8217;ll get into that later). The order of the options doesn&#8217;t matter; the -j DROP could go before -s 200.200.200.1. I just like to put the outcome part at the end of the command. Ok, we&#8217;re now capable of ignoring a certain computer on a network. If you wanted to keep your computer from talking to it, you&#8217;d simply change INPUT to OUTPUT and change the -s to -d for destination. Now that&#8217;s not too hard, is it?</p>
<p>So what if we only wanted to ignore telnet requests from this computer? Well that&#8217;s not very hard either. You might know that port 23 is for telnet, but you can just use the word telnet if you like. There are at least 3 protocols that can be specified: TCP, UDP, and ICMP. Telnet, like most services, runs on TCP so we&#8217;re going with it. The -p option specifies the protocol. But TCP doesn&#8217;t tell it everything; telnet is only a specific protocol used on the larger protocol of TCP. After we specify that the protocol is TCP, we can use &#8211;destination-port to denote the port that they&#8217;re trying to contact us on. Make sure you don&#8217;t get source and destination ports mixed up. Remember, the client can run on any port, it&#8217;s the server that will be running the service on port 23. Any time you want to block out a certain service, you&#8217;ll use &#8211;destination-port. The opposite is &#8211;source-port in case you need it. So let&#8217;s put this all together. This should be the command that accomplishes what we want:</p>
<p>iptables -A INPUT -s 200.200.200.1 -p tcp &#8211;destination-port telnet -j DROP</p>
<p>And there you go. If you wanted to specify a range of IP&#8217;s, you could use 200.200.200.0/24. This would specify any IP that matched 200.200.200.*. Now it&#8217;s time to fry some bigger fish. Let&#8217;s say that, like me, you have a local area network and then you have a connection to the internet. We&#8217;re going to also say that the LAN is eth0 while the internet connection is called ppp0. Now suppose we wanted to allow telnet to run as a service to computers on the LAN but not on the insecure internet. Well there is an easy way to do this. We can use -i for the input interface and -o for the output interface. You could always block it on the OUTPUT chain, but we&#8217;d rather block it on the INPUT so that the telnet daemon never even sees the request. Therefore we&#8217;ll use -i. This should set up just the rule:</p>
<p>iptables -A INPUT -p tcp &#8211;destination-port telnet -i ppp0 -j DROP</p>
<p>So this should close off the port to anyone on the internet yet kept it open to the LAN. Now before we go on to more intense stuff, I&#8217;d like to briefly explain other ways to manipulate rules. The -A option appends a rule to the end of the list, meaning any matching rule before it will have say before this one does. If we wanted to put a rule before the end of the chain, we use -I for insert. This will put the rule in a numerical location in the chain. For example, if we wanted to put it at the top of the INPUT chain, we&#8217;d use &#8220;-I INPUT 1&#8243; along with the rest of the command. Just change the 1 to whatever place you want it to be in. Now let&#8217;s say we wanted to replace whatever rule was already in that location. Just use -R to replace a rule. It has the same syntax as -I and works the same way except that it deletes the rule at that position rather than bumping everything down. And finally, if you just want to delete a rule, use -D. This also has a similar syntax but you can either use a number for the rule or type out all the options that you would if you created the rule. The number method is usually the optimal choice. There are two more simple options to learn though. -L lists all the rules set so far. This is obviously helpful when you forget where you&#8217;re at. AND -F flushes a certain chain. (It removes all of the rules on the chain.) If you don&#8217;t specify a chain, it will basically flush everything.</p>
<p>Well let&#8217;s get a bit more advanced. We know that these packets use a certain protocol, and if that protocol is TCP, then it also uses a certain port. Now you might be compelled to just close all ports to incoming traffic, but remember, after your computer talks to another computer, that computer must talk back. If you close all of your incoming ports, you&#8217;ll essentially render your connection useless. And for most non-service programs, you can&#8217;t predict which port they&#8217;re going to be communicating on. But there&#8217;s still a way. Whenever two computers are talking over a TCP connection, that connection must first be initialized. This is the job of a SYN packet. A SYN packet simply tells the other computer that it&#8217;s ready to talk. Now only the computer requesting the service sends a SYN packet. So if you only block incoming SYN packets, it stops other computers from opening services on your computer but doesn&#8217;t stop you from communicating with them. It roughly makes your computer ignore anything that it didn&#8217;t speak to first. It&#8217;s mean but it gets the job done. Well the option for this is &#8211;syn after you&#8217;ve specified the TCP protocol. So to make a rule that would block all incoming connections on only the internet:</p>
<p>iptables -A INPUT -i ppp0 -p tcp &#8211;syn -j DROP</p>
<p>That&#8217;s a likely rule that you&#8217;ll be using unless you have a web service running. If you want to leave one port open, for example 80 (HTTP), there&#8217;s a simple way to do this too. As with many programming languages, an exclamation mark means not. For instance, if you wanted to block all SYN packets on all ports except 80, I believe it would look something like this:</p>
<p>iptables -A INPUT -i ppp0 -p tcp &#8211;syn &#8211;destination-port ! 80 -j DROP</p>
<p>It&#8217;s somewhat complicated but it&#8217;s not so hard to comprehend. There&#8217;s one last thing I&#8217;d like to cover and that&#8217;s changing the policy for a chain. The chains INPUT and OUTPUT are usually set to ACCEPT by default and FORWARD is set to DENY. Well if you want to use this computer as a router, you would probably want to set the FORWARD policy to ACCEPT. How do we do this you ask? Well it&#8217;s really very simple. All you have to do is use the -P option. Just follow it by the chain name and the new policy and you have it made. To change the FORWARD chain to an ACCEPT policy, we&#8217;d do this:</p>
<p>iptables -P FORWARD ACCEPT</p>
<p>Nothing to it, huh? This is really just the basics of iptables. It should help you set up a limited firewall but there&#8217;s still a lot more that I couldn&#8217;t talk about. You can look at the man page &#8220;man iptables&#8221; to learn more of the options (or refresh your memory when you forget). You can find more advanced documents if you want to learn some of the more advanced features of iptables. At the time of this writing, iptables documents are somewhat rare because the technology is new but they should be springing up soon. Good luck.</p>
<p>Helpful Links:<br />
Introducing Netfilter (iptables)<br />
<a href="http://www.linuxsecurity.com/docs/colsfaq.html">http://www.linuxsecurity.com/docs/colsfaq.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.articledesktop.com/linux/learn-linux-firewall-using-iptables/18/feed</wfw:commentRss>
		</item>
		<item>
		<title>how to update mozilla firefox from 1.5 to 2.0 in linux</title>
		<link>http://www.articledesktop.com/linux/how-to-update-mozilla-firefox-from-15-to-20-in-linux/17</link>
		<comments>http://www.articledesktop.com/linux/how-to-update-mozilla-firefox-from-15-to-20-in-linux/17#comments</comments>
		<pubDate>Mon, 26 Feb 2007 16:11:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.articledesktop.com/linux/how-to-update-mozilla-firefox-from-15-to-20-in-linux/17</guid>
		<description><![CDATA[In any fedora 1-6 distribution version you can find firefox 1.5
and unable to use great features like themes and  other addons and many securities issues
here is simple method to upgrade firefox 1.5 to 2.0.0.1
simply type
yum -y -t &#8211;enable=development update firefox
if any conflict occur, generally with mozilla-1.7.12
then type ( only if error occurred )
yum remove [...]]]></description>
			<content:encoded><![CDATA[<p>In any fedora 1-6 distribution version you can find firefox 1.5<br />
and unable to use great features like themes and  other addons and many securities issues<br />
here is simple method to upgrade firefox 1.5 to 2.0.0.1</p>
<p>simply type</p>
<p><span style="color: red">yum -y -t &#8211;enable=development update firefox</span></p>
<p>if any conflict occur, generally with mozilla-1.7.12</p>
<p>then type ( only if error occurred )</p>
<p><span style="color: blue">yum remove /usr/lib/mozilla-1.7.12</span></p>
<p>and then type</p>
<p><span style="color: red">yum -y -t &#8211;enable=development update firefox</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.articledesktop.com/linux/how-to-update-mozilla-firefox-from-15-to-20-in-linux/17/feed</wfw:commentRss>
		</item>
		<item>
		<title>Ajax Without XmlHttpRequest</title>
		<link>http://www.articledesktop.com/general/ajax-without-xmlhttprequest/16</link>
		<comments>http://www.articledesktop.com/general/ajax-without-xmlhttprequest/16#comments</comments>
		<pubDate>Wed, 13 Dec 2006 23:21:00 +0000</pubDate>
		<dc:creator>tejas</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://www.articledesktop.com/?p=16</guid>
		<description><![CDATA[IE 6 does support built in as an ActiveX control for XMLHttpRequest. Which means your visitors get an ugly warning message about the possible danger of an ActiveX control, or in some cases it just doesn't work at all.

If we can't use the XmlHttpRequest object, we must find some other way to include content from another page, without having to resort to other objects or non-standard things. A great candidate for this would be the tag, which is used to include external JavaScript files. What if, instead of using a regular JS file, we point that tag to a PHP file, which outputs JavaScript. ]]></description>
			<content:encoded><![CDATA[<p>IE 6 does support built in as an ActiveX control for XMLHttpRequest. Which means your visitors get an ugly warning message about the possible danger of an ActiveX control, or in some cases it just doesn’t work at all.</p>
<p>If we can’t use the XmlHttpRequest object, we must find some other way<br />
to include content from another page, without having to resort to other objects<br />
or non-standard things. A great candidate for this would be the tag, which is<br />
used to include external JavaScript files. What if, instead of using a regular<br />
JS file, we point that tag to a PHP file, which outputs JavaScript. A PHP file<br />
which looks something like this:</p>
<blockquote>
<pre>&lt;?php</pre>
<pre>	$html = '&lt;b&gt;This content came from our Ajax Engine&lt;/b&gt;';</pre>
<pre>?&gt;</pre>
<pre>div = document.getElementById('contentdiv');
div.innerHTML = '&lt;?php echo $html; ?&gt;';</pre>
</blockquote>
<p>When this file is used referenced in a script tag, it will try to set the innerHTML of a div with ID ‘contentdiv’. But there’s one problem; this file shouldn’t be included when the page loads, but only when a button is clicked or some other action. To do this, we must somehow dynamically add a new script tag, which is possible using JavaScript. Something like the following would do the trick:</p>
<blockquote>
<pre>// Get base url
     url = document.location.href;
     xend = url.lastIndexOf("/") + 1;
     var base_url = url.substring(0, xend);</pre>
<pre>function ajax_do (url) {
     // Does URL begin with http?
     if (url.substring(0, 4) != 'http') {
     url = base_url + url;
     }</pre>
<pre> // Create new JS element
     var jsel = document.createElement('SCRIPT');
     jsel.type = 'text/javascript';
     jsel.src = url;</pre>
<pre> // Append JS element (therefore executing the 'AJAX' call)
     document.body.appendChild (jsel);
 }</pre>
</blockquote>
<p>This code first gets the current directory of the url, so we have a base url.<br />
The ‘ajax_do’ function is the thing that does all the work. It first<br />
checks whether the url passed to the function points to another domain, or is<br />
a relative file.</p>
<p>It then creates a new script element, using the createElement() function. After that it sets the src attribute of the script element, and adds the script element to the body, effectively ‘loading’ the file that is referenced by the script element.</p>
<p>All we need now is a simple page that triggers the Ajax call, i.e.</p>
<blockquote>
<pre>     &lt;html&gt;
     &lt;head&gt;
     &lt;title&gt; Demo 1 - The Basic's &lt;/title&gt;</pre>
<pre> &lt;script type = 'text/javascript' src = 'engine.js' &gt; &lt;/script&gt;
 &lt;/head&gt;</pre>
<pre> &lt;body&gt;
   &lt;div id = 'contentdiv' &gt;&lt;/div&gt;</pre>
<pre>&lt;input type = 'button' onclick = "ajax_do ('page1.php');" value = "Get content" / &gt;
     &lt;/body&gt;
     &lt;/html&gt;</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.articledesktop.com/general/ajax-without-xmlhttprequest/16/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
