<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Free Linux Tutorials</title>
	<atom:link href="http://freelinuxtutorials.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://freelinuxtutorials.com</link>
	<description>/var/net/sys/admin/blog</description>
	<lastBuildDate>Thu, 02 May 2013 16:41:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Installation and Setup of Free Tacacs+ server in Linux</title>
		<link>http://freelinuxtutorials.com/tutorials/installation-setup-of-free-tacacs-server-in-linux/</link>
		<comments>http://freelinuxtutorials.com/tutorials/installation-setup-of-free-tacacs-server-in-linux/#comments</comments>
		<pubDate>Thu, 02 May 2013 16:26:45 +0000</pubDate>
		<dc:creator>Free Linux Tutorials</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[tacacs]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://freelinuxtutorials.com/?p=620</guid>
		<description><![CDATA[<p>Installation &#38; Setup of Free Tacacs+ server in Linux (Tested via GNS3 &#38; VirtualBox) Software Used: GNS3 0.8.3.1 -use 3700 IOS as Router &#38; DHCP -use Ethernet switch to connect hosts -use VirtualBox guest running on Ubuntu Linux server 12.04.2 LTS http://shrubbery.net/tac_plus/ Installation: 1.Login as root and install dependencies such as tcp wrappers and compilation [...]</p><p>The post <a href="http://freelinuxtutorials.com/tutorials/installation-setup-of-free-tacacs-server-in-linux/">Installation and Setup of Free Tacacs+ server in Linux</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Installation &amp; Setup of Free Tacacs+ server in Linux<br />
(Tested via GNS3 &amp; VirtualBox)</p>
<p>Software Used:</p>
<p>GNS3 0.8.3.1<br />
-use 3700 IOS as Router &amp; DHCP<br />
-use Ethernet switch to connect hosts<br />
-use VirtualBox guest running on Ubuntu Linux server 12.04.2 LTS</p>
<p>http://shrubbery.net/tac_plus/</p>
<p>Installation:</p>
<p>1.Login as root and install dependencies such as tcp wrappers and compilation tools e.g. gcc, bison, flex, make</p>
<p>If you&#8217;re not sure if these packages are installed, you can use the command:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;">dpkg -s [packagename]</pre>
<p>Sample:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 320px; height: 20px; text-align: left;">root@freelinux:~# dpkg -s gcc bison flex</pre>
<p>Package `gcc&#8217; is not installed and no info is available.</p>
<p>Package `bison&#8217; is not installed and no info is available.</p>
<p>Package `flex&#8217; is not installed and no info is available.</p>
<p>To install:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 460px; height: 50px; text-align: left;">root@freelinux:~# apt-get install gcc make flex \
 bison libwrap0-dev</pre>
<p>2. Download the tacacs+ package on ftp://ftp.shrubbery.net/pub/tac_plus/. It&#8217;s good to read additional information or changes on http://shrubbery.net/tac_plus/.</p>
<p>Latest version as of this writing is tacacs+-F4.0.4.26</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 490px; height: 50px; text-align: left;">root@freelinux:~# wget \
ftp://ftp.shrubbery.net/pub/tac_plus/tacacs+-F4.0.4.26.tar.gz</pre>
<p>3. uncompress the tarball file</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 460px; height: 30px; text-align: left;">root@ubuntu:~# tar zxvf tacacs+-F4.0.4.26.tar.gz</pre>
<p>4. Build<br />
check the INSTALL file first to see the installation guide</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 360px; height: 40px; text-align: left;">root@ubuntu:~/tacacs+-F4.0.4.26# less INSTALL
root@ubuntu:~/tacacs+-F4.0.4.26# ./configure</pre>
<p>If you missed installing those dependecies, you will receive messages something like this:</p>
<p>configure: error: Could not find libwrap. You must first install tcp_wrappers.</p>
<p>So to resolve this, install the necessary packages.</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 460px; height: 20px; text-align: left;"># apt-get install libwrap0-dev</pre>
<p>Libraries have been installed in:<br />
/usr/local/lib</p>
<p>If you ever happen to want to link against installed libraries<br />
in a given directory, LIBDIR, you must either use libtool, and<br />
specify the full pathname of the library, or use the `-LLIBDIR&#8217;<br />
flag during linking and do at least one of the following:<br />
- add LIBDIR to the `LD_LIBRARY_PATH&#8217; environment variable<br />
during execution<br />
- add LIBDIR to the `LD_RUN_PATH&#8217; environment variable<br />
during linking<br />
- use the `-Wl,-rpath -Wl,LIBDIR&#8217; linker flag<br />
- have your system administrator add LIBDIR to `/etc/ld.so.conf&#8217;</p>
<p>See any operating system documentation about shared libraries for<br />
more information, such as the ld(1) and ld.so(8) manual pages.</p>
<p>Configuration:</p>
<p>1. After extracting the files, default directory would be /usr/local/bin/</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 460px; height: 40px; text-align: left;">root@ubuntu:~/tacacs+-F4.0.4.26# ls /usr/local/bin/tac*
/usr/local/bin/tac_plus /usr/local/bin/tac_pwd</pre>
<p>2. Read the manual page for the following:</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 320px; height: 40px; text-align: left;">$man tac_plus
$man tac_pwd</pre>
<p>So basically,<br />
tac_plus &#8211; tacacs plus daemon<br />
tac_pwd &#8211; generate DES or MD5 encryption of a password</p>
<p>3. use tac_pwd to encrypt clear text passwords to make it more secure<br />
e.g.<br />
We want to use &#8220;password&#8221; to login the username freelinux and &#8220;enablepass&#8221; to go privilege mode</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 460px; height: 60px; text-align: left;">root@freelinux:/etc/tacacs# /usr/local/bin/tac_pwd
Password to be encrypted: password
VUjB99kC2IGws</pre>
<p>&nbsp;</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 460px; height: 60px; text-align: left;">root@freelinux:/etc/tacacs# /usr/local/bin/tac_pwd
Password to be encrypted: enablepass
HD.Hw0OHKmO/c</pre>
<p>4. Setup config files</p>
<p>a.create tacacs directory under /etc</p>
<p>5. create the tac_plus.conf file</p>
<p>tac_plus.conf setup:<br />
i. set the key</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 40px; text-align: left;">#tacacs key
key = "tackey"</pre>
<p>ii. set the user accounts</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 290px; height: 140px; text-align: left;">#user details
#admin freelinuxtutorials@gmail.com
user = freelinux {
default service = permit
member = admingroup
login = des VUjB99kC2IGws
}</pre>
<p>iii. set the group details</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 160px; text-align: left;">#group details
# admin group
group = admingroup {
default service = permit
service = exec {
priv-lvl = 15
}
}</pre>
<p>iv. set enable password</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 80px; text-align: left;">#Enable password setup for users:
user = $enable$ {
login = des HD.Hw0OHKmO/c
}</pre>
<pre>Note: This is how it looks like, get it <a title="freelinux sample basic tacacs config" href="http://freelinuxtutorials.com/freefiles/freelinux-sample-tacacs-config.txt" target="_blank">here</a>
v. set the location of the accounting file</pre>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 460px; height: 20px; text-align: left;">accounting file = /var/log/tacacs/tac_plus.log</pre>
<p>6. change permission</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 460px; height: 20px; text-align: left;">#chmod 600 /etc/tacacs/tac_plus.conf</pre>
<p>Note: If along the way, if you encoutered such as below, then you need to create necessary links using ldconfig</p>
<p>tac_plus: error while loading shared libraries: libtacacs.so.1:<br />
cannot open shared object file: No such file or directory</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;"># vi /etc/ld.so.conf</pre>
<p>add /usr/local/lib under /etc/ld.so.conf</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;"> root@freelinux#ldconfig</pre>
<p>7. Run the tacacs service</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 460px; height: 40px; text-align: left;">root@freelinux:/etc/tacacs# /etc/init.d/tac_plus start
Starting Tacacs+ server: tac_plus.</pre>
<p>this tac_plus file, contents can be downloaded <a title="freelinux tac_plus service" href="http://freelinuxtutorials.com/freefiles/freelinux-tac_plus.txt" target="_blank">here</a></p>
<p>8. check if process running</p>
<pre class="alt2" dir="ltr" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 460px; height: 40px; text-align: left;">root@freelinux:/etc/tacacs# netstat -na | grep 49
tcp 0 0 0.0.0.0:49 0.0.0.0:* LISTEN</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Sample Cisco configuration</p>
<p>Configuring Cisco:</p>
<p>Cisco&gt;en<br />
Cisco#conf t<br />
Cisco#service password-encryption<br />
Cisco#tacacs-server host 192.168.56.10<br />
Cisco#tacacs-server directed-request<br />
Cisco#tacacs-server key tackey</p>
<p>Cisco#aaa new-model<br />
Cisco#aaa authentication login default group tacacs+ local<br />
Cisco#aaa authentication enable default group tacacs+ enable<br />
Cisco#aaa authorization commands 1 default group tacacs+ local<br />
Cisco#aaa authorization commands 15 default group tacacs+ local<br />
Cisco#aaa accounting commands 0 default start-stop group tacacs+<br />
Cisco#aaa accounting commands 1 default start-stop group tacacs+<br />
Cisco#aaa accounting commands 7 default start-stop group tacacs+<br />
Cisco#aaa accounting commands 15 default start-stop group tacacs+<br />
Cisco#aaa accounting network 15 start-stop group tacacs+<br />
Cisco#aaa accounting connection 15 start-stop group tacacs+</p>
<p>I will not go deeper into client configuration as it differs on devices and softwares by different vendors. Anyway, what has shown here is just the basic tacacs config that is proven working. Go try explore further the advance tacacs configuration. Enjoy!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffreelinuxtutorials.com%2Ftutorials%2Finstallation-setup-of-free-tacacs-server-in-linux%2F&amp;title=Installation%20and%20Setup%20of%20Free%20Tacacs%2B%20server%20in%20Linux" id="wpa2a_2"><img src="http://freelinuxtutorials.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a href="http://freelinuxtutorials.com/tutorials/installation-setup-of-free-tacacs-server-in-linux/">Installation and Setup of Free Tacacs+ server in Linux</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelinuxtutorials.com/tutorials/installation-setup-of-free-tacacs-server-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Kernel 3.6.8 is released!</title>
		<link>http://freelinuxtutorials.com/news-and-updates/linux-kernel-3-6-8-is-released/</link>
		<comments>http://freelinuxtutorials.com/news-and-updates/linux-kernel-3-6-8-is-released/#comments</comments>
		<pubDate>Tue, 27 Nov 2012 09:36:11 +0000</pubDate>
		<dc:creator>Free Linux Tutorials</dc:creator>
				<category><![CDATA[News and Updates]]></category>

		<guid isPermaLink="false">http://freelinuxtutorials.com/?p=594</guid>
		<description><![CDATA[<p>Latest stable Linux kernel  is now ready for download on Linux Kernel archives or kernel.org. #linux http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.6.8.tar.bz2</p><p>The post <a href="http://freelinuxtutorials.com/news-and-updates/linux-kernel-3-6-8-is-released/">Linux Kernel 3.6.8 is released!</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Latest stable Linux kernel  is now ready for download on Linux Kernel archives or kernel.org. #linux</p>
<p><a title="Latest stable linux kernel 3.6.8" href="http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.6.8.tar.bz2" target="_blank">http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.6.8.tar.bz2</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffreelinuxtutorials.com%2Fnews-and-updates%2Flinux-kernel-3-6-8-is-released%2F&amp;title=Linux%20Kernel%203.6.8%20is%20released%21" id="wpa2a_4"><img src="http://freelinuxtutorials.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a href="http://freelinuxtutorials.com/news-and-updates/linux-kernel-3-6-8-is-released/">Linux Kernel 3.6.8 is released!</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelinuxtutorials.com/news-and-updates/linux-kernel-3-6-8-is-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH authentication via Public/Private keys</title>
		<link>http://freelinuxtutorials.com/tutorials/ssh-authentication-via-public-private-keys/</link>
		<comments>http://freelinuxtutorials.com/tutorials/ssh-authentication-via-public-private-keys/#comments</comments>
		<pubDate>Sat, 03 Nov 2012 05:03:08 +0000</pubDate>
		<dc:creator>Free Linux Tutorials</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://freelinuxtutorials.com/?p=507</guid>
		<description><![CDATA[<p>For the tutorial &#8220;Securing your OpenSSH server in Linux&#8221; , key-based authentication is one way to secure your SSH server. Below are the details how it&#8217;s done: Users can login remotely to Secure Shell(SSH) server using public/private key without typing the password. This can put added security on your boxes as it reduces password cracking [...]</p><p>The post <a href="http://freelinuxtutorials.com/tutorials/ssh-authentication-via-public-private-keys/">SSH authentication via Public/Private keys</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>For the tutorial &#8220;<a title="Securing your OpenSSH server in Linux" href="http://freelinuxtutorials.com/tutorials/securing-your-openssh-server" target="_blank">Securing your OpenSSH server in Linux&#8221;</a> , key-based authentication is one way to secure your SSH server. Below are the details how it&#8217;s done:</p>
<p>Users can login remotely to Secure Shell(SSH) server using public/private key without typing the password. This can put added security on your boxes as it reduces password cracking attempts. Aside from that, it will give convenience to users especially if running scripts that require SCP or SFTP transfers.</p>
<p>These are the steps on doing this:</p>
<p>1. Generate a public/private key pair on the client to identify on the servers. It can be protected with password/passphrase or choose not to have</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">ssh-keygen -t rsa</pre>
<p>[darwin@freelinuxclient ~]$ ssh-keygen -t rsa<br />
Generating public/private rsa key pair.<br />
Enter file in which to save the key (/home/darwin/.ssh/id_rsa):<br />
Created directory &#8216;/home/darwin/.ssh&#8217;.<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /home/darwin/.ssh/id_rsa.<br />
Your public key has been saved in /home/darwin/.ssh/id_rsa.pub.<br />
The key fingerprint is:<br />
ec:e2:2c:72:f4:0d:a2:ce:83:5a:b1:f3:ee:e1:f3:9f darwin@freelinuxclient<br />
[darwin@freelinuxclient ~]$</p>
<p>It will create two files under your .ssh folder</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">ls -la ~/.ssh/</pre>
<p>[darwin@freelinuxclient ~]$ ls -la ~/.ssh/<br />
total 16<br />
drwx&#8212;&#8212; 2 darwin darwin 4096 Nov  2 23:30 .<br />
drwx&#8212;&#8212; 3 darwin darwin 4096 Nov  2 23:29 ..<br />
-rw&#8212;&#8212;- 1 darwin darwin 1743 Nov  2 23:30 id_rsa<br />
-rw-r&#8211;r&#8211; 1 darwin darwin  410 Nov  2 23:30 id_rsa.pub</p>
<p>id_rsa = private key<br />
id_rsa.pub = public key (it&#8217;s the one you are going to upload on the server)</p>
<p>2. Set permission on private key</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 480px; height: 35px; text-align: left;" dir="ltr">[darwin@freelinuxclient ~]$ chmod 700 ~/.ssh/
[darwin@freelinuxclient ~]$ chmod 600 ~/.ssh/id_rsa</pre>
<p>Normally, the correct permission is already set by default but it&#8217;s better to do this esp. if &#8220;StrictModes&#8221; is set yes on your sshd_config.</p>
<p>3. Upload the id_rsa.pub or public key to server</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 400px; height: 30px; text-align: left;" dir="ltr">$scp ~/.ssh/id_rsa.pub user@server:</pre>
<p>[darwin@freelinuxclient .ssh]$scp /home/darwin/.ssh/id_rsa.pub darwin@freelinuxserver:~/</p>
<p>4. Add to the authorized keys</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 400px; height: 20px; text-align: left;" dir="ltr">cat id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys</pre>
<p>[darwin@freelinuxclient ~]$ ssh darwin@freelinuxserver<br />
darwin@freelinuxserver&#8217;s password:<br />
[darwin@freelinuxserver]$ cat id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys<br />
<em>Testing</em>:<br />
SSH to the server, if password is provided during the generation of client key pairs, it will ask during</p>
<p>[darwin@freelinuxclient ~]$ ssh darwin@freelinuxserver<br />
Enter passphrase for key &#8216;/home/darwin/.ssh/id_rsa&#8217;:<br />
[darwin@freelinuxserver ~]$</p>
<p>If no passphrase provided, then access would be direct:</p>
<p>[darwin@freelinuxclient ~]$ ssh darwin@freelinuxserver<br />
[darwin@freelinuxserver ~]$</p>
<p><em>Additional Notes:</em></p>
<p>1. Make sure public key authentication is enabled (should be enabled by default)<br />
[darwin@freelinuxserver ~]#vi /etc/ssh/sshd_config</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 40px; text-align: left;" dir="ltr">RSAAuthentication yes
PubkeyAuthentication yes</pre>
<p>2. SSH usually comes  with the &#8220;ssh-copy-id&#8221; utility that will install the id_rsa.pub to the server&#8217;s authorized keys.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 400px; height: 20px; text-align: left;" dir="ltr">ssh-copy-id -i .ssh/id_rsa.pub user@server</pre>
<p>[darwin@freelinuxclient ~]$ ssh-copy-id -i .ssh/id_rsa.pub darwin@freelinuxserver<br />
15<br />
darwin@freelinuxserver&#8217;s password:<br />
Now try logging into the machine, with &#8220;ssh &#8216;darwin@freelinuxserver&#8217;&#8221;, and check in:</p>
<p>.ssh/authorized_keys</p>
<p>to make sure we haven&#8217;t added extra keys that you weren&#8217;t expecting.</p>
<p>[darwin@freelinuxclient ~]$<br />
3. To disable password authentication, item a is recommended</p>
<p>a. disable via the /etc/ssh/sshd_config</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 400px; height: 50px; text-align: left;" dir="ltr">ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no</pre>
<p>b. lock user account on the server, key authentication will still work</p>
<p>[root@freelinuxserver ~]# passwd -l darwin<br />
Locking password for user darwin.<br />
passwd: Success<br />
[root@freelinuxserver ~]#</p>
<p>4. If you need to change or add key pair&#8217;s passphrase, use the -p option</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr"> ssh-keygen -p</pre>
<p>[darwin@freelinuxclient ~]$ ssh-keygen -p<br />
Enter file in which the key is (/home/darwin/.ssh/id_rsa):<br />
Enter old passphrase:<br />
Key has comment &#8216;/home/darwin/.ssh/id_rsa&#8217;<br />
Enter new passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved with the new passphrase.</p>
<p>5. You can use &#8220;DSA&#8221; as SSH2 authentication key. DSA authenticates or signs faster,but slower in verification. To do this:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">ssh-keygen -t dsa</pre>
<p>This will create two files, id_dsa &amp; id_dsa.pub.</p>
<p>6. Once imported as public key, it&#8217;s recommended to delete it from the server</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">rm id_rsa.pub</pre>
<p>[darwin@freelinuxserver ~]#rm id_rsa.pub</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffreelinuxtutorials.com%2Ftutorials%2Fssh-authentication-via-public-private-keys%2F&amp;title=SSH%20authentication%20via%20Public%2FPrivate%20keys" id="wpa2a_6"><img src="http://freelinuxtutorials.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a href="http://freelinuxtutorials.com/tutorials/ssh-authentication-via-public-private-keys/">SSH authentication via Public/Private keys</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelinuxtutorials.com/tutorials/ssh-authentication-via-public-private-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing your OpenSSH server in Linux</title>
		<link>http://freelinuxtutorials.com/tutorials/securing-your-openssh-server/</link>
		<comments>http://freelinuxtutorials.com/tutorials/securing-your-openssh-server/#comments</comments>
		<pubDate>Sat, 20 Oct 2012 04:58:08 +0000</pubDate>
		<dc:creator>Free Linux Tutorials</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AllowUsers]]></category>
		<category><![CDATA[Banner]]></category>
		<category><![CDATA[ClientAliveCountMax]]></category>
		<category><![CDATA[ClientAliveInterval]]></category>
		<category><![CDATA[DenyUsers]]></category>
		<category><![CDATA[HostbasedAuthentication]]></category>
		<category><![CDATA[hosts.allow]]></category>
		<category><![CDATA[hosts.deny]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[LoginGraceTime]]></category>
		<category><![CDATA[OpenSSH]]></category>
		<category><![CDATA[pam]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[PermitEmptyPasswords]]></category>
		<category><![CDATA[PermitRootLogin]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[system-auth]]></category>

		<guid isPermaLink="false">http://freelinuxtutorials.com/?p=488</guid>
		<description><![CDATA[<p>Secure Shell (SSH) is a program used to secure communication between two entities, often used as a replacement for Telnet and the Berkeley protocols such as remote shell (RSH) and remote login (Rlogin). SSH is also used as a secure remote copy utility, replacing traditional protocols such as the File Transfer Protocol (FTP) and Remote [...]</p><p>The post <a href="http://freelinuxtutorials.com/tutorials/securing-your-openssh-server/">Securing your OpenSSH server in Linux</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Secure Shell (SSH) is a program used to secure communication between two entities, often used as a replacement for Telnet and the Berkeley protocols such as remote shell (RSH) and remote login (Rlogin). SSH is also used as a secure remote copy utility, replacing traditional protocols such as the File Transfer Protocol (FTP) and Remote Copy Protocol (RCP).</p>
<p>For this tutorial, we are going to demonstrate steps on securing your <strong>OpenSSH</strong> which is a free version of the SSH protocol suite.</p>
<p>Note: Steps 1-9 can be done by  tweaking your sshd_config and do ssh service restart after changes to take effect.</p>
<p>1. <strong>Use SSH Protocol 2</strong><br />
Use SSH version 2 (SSH2) only as it offers more performance, flexibility and security than SSH1.<br />
-To verify what SSH protocol version you are running, check your /etc/ssh/sshd_config and look for the line &#8220;Protocol&#8221;,</p>
<p>[root@freelinux ~]# vi /etc/ssh/sshd_config</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">Protocol 2</pre>
<p>[root@freelinux ~]# /etc/init.d/sshd restart<br />
Stopping sshd: [  OK  ]<br />
Starting sshd: [  OK  ]</p>
<p>2. <strong>Disable direct root SSH logins</strong><br />
-disable direct logging in as root via ssh. This is like inviting hackers to brute force your root password.<br />
It&#8217;s recommend to login as a normal user and then after that, just use su or sudo if want to execute priviledge commands.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">PermitRootLogin no</pre>
<p>3. <strong>Enable a SSH warning banner</strong><br />
You can display a warning banner before login to require acknowledgment of the contents. This can be done by defining under sshd_config</p>
<p>a. Create a Banner on any location. e.g. /etc/freelinux</p>
<p>[root@freelinux~]# vi /etc/freelinux<br />
###############################################################<br />
AUTHORIZED USERS ONLY<br />
All login attempts will be logged!!!<br />
###############################################################</p>
<p>b. Edit /etc/ssh/sshd_config. Locate the line containing &#8220;Banner&#8221;, uncomment and specify the file location<br />
vi /etc/ssh/sshd_config</p>
<p># no default banner path</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">Banner /etc/freelinux</pre>
<p>c. Restart ssh service</p>
<p>[root@freelinux~]# service sshd restart<br />
Stopping sshd: [  OK  ]<br />
Starting sshd: [  OK  ]</p>
<p>d. Test:<br />
@ssh client<br />
login as: darwin<br />
###############################################################<br />
AUTHORIZED USERS ONLY<br />
All login attempts will be logged!!!<br />
###############################################################<br />
darwin@10.0.2.100&#8242;s password:<br />
Last login: Fri Oct 19 18:19:12 2012 from 10.0.2.2</p>
<p>4. <strong>Disable empty passwords</strong><br />
To disable empty password, edit /etc/ssh/sshd_config and make sure this line below is uncommented</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">PermitEmptyPasswords no</pre>
<p>5. <strong>Disable Host-based authentication</strong><br />
It is not recommended that hosts always agreed to trust one another</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">HostbasedAuthentication no</pre>
<p>6. <strong>Configure Idle Timeout<br />
</strong>Let say you want the system to log out users after 15 mins of idling. Then you can set this:</p>
<p>[root@freelinux~]# vi /etc/ssh/sshd_config</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 40px; text-align: left;" dir="ltr">ClientAliveInterval 300
ClientAliveCountMax 3</pre>
<p>where:</p>
<p>This will give a timeout of 15 minutes (300 secs X 3)<br />
ClientAliveInterval &#8211; timeout in seconds.<br />
ClientAliveCountMax &#8211; total number of checkalive message sent by the ssh server without getting any response from the ssh client</p>
<p>Also,  you can do this 15 minute timeout:<br />
ClientAliveInterval 900<br />
ClientAliveCountMax 0</p>
<p>Additional Tip: This is slightly different with &#8220;TMOUT&#8221; variable that will terminate the shell if no activity for N seconds<br />
# export TMOUT=N</p>
<p>[root@freelinux~]# export TMOUT=60</p>
<p>7. <strong>Limit SSH LoginGraceTime</strong><br />
By default, sshd will allow a connected user that has not begun the authentication process for a period 2 minutes (120 secs) for a grace time. It&#8217;s recommended to shorten this time to protect from brute force attacks.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">LoginGraceTime 30</pre>
<p>8.<strong> Change ssh port number</strong><br />
The advantage of this is somehow protects your box against automated attacks or malicious scripts that is trying to get in via ssh default port 22.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">Port 35286</pre>
<p>9. <strong>Limit or Permit only specific users or groups to login</strong><br />
All users by default is allowed to access your box. But you have the options to allow or deny few users or groups. This can be done in either of this way.</p>
<p>#[AllowUsers]</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 20px; text-align: left;" dir="ltr">AllowUsers darwin tux</pre>
<p>OR</p>
<p>#[DenyUsers]</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 260px; height: 40px; text-align: left;" dir="ltr">DenyUsers user1 user2
DenyGroups group1 group2 group3</pre>
<p>10. <strong>Update OpenSSH &amp; OS</strong><br />
Make sure your Linux system is running the latest version for OpenSSH. SSH package version depends on your Linux distribution &amp; OS version. Your distro will use the best or stable version for any packages, so if you want to upgrade to another version, you can do this via source package installation. It can be downloaded on OpenSSH official site <a title="OpenSSH" href="http://www.openssh.com" target="_blank">http://www.openssh.com</a>. Alternatively, you can do it by installing the latest rpm package or changing your repository, then use the yum.</p>
<p>For instance, if you are running CentOS 5.8 to check the current installed package and verify if there&#8217;s update, tr the following:</p>
<p>[root@freelinux~]# cat /etc/issue<br />
CentOS release 5.8 (Final)<br />
Kernel \r on an \m</p>
<p>[root@freelinux~]# rpm -qa | grep openssh<br />
openssh-4.3p2-82.el5<br />
openssh-clients-4.3p2-82.el5<br />
openssh-server-4.3p2-82.el5</p>
<p>[root@freelinux~]# ssh -V<br />
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008</p>
<p>[root@freelinux~]# yum update openssh*<br />
Loaded plugins: fastestmirror, security<br />
Determining fastest mirrors<br />
* base: mirror.nus.edu.sg<br />
* extras: mirror.nus.edu.sg<br />
* updates: mirror.nus.edu.sg<br />
base                                                     | 1.1 kB     00:00<br />
extras                                                   | 1.9 kB     00:00<br />
extras/primary_db                                        | 171 kB     00:00<br />
updates                                                  | 1.9 kB     00:00<br />
updates/primary_db                                       | 828 kB     00:01<br />
Skipping security plugin, no data<br />
Setting up Update Process<br />
No Packages marked for Update</p>
<p>11. <strong>Enforce access controls list by using TCP wrappers</strong><br />
TCP wrappers is used to restrict access to TCP services based on IP, hostname, network address etc. It supports SSH via the libwrap library. To check if your sshd is</p>
<p>dynamically linked against libwrap:</p>
<p>[root@freelinux~]# which sshd<br />
/usr/sbin/sshd<br />
[root@freelinux~]# ldd /usr/sbin/sshd | grep libwrap<br />
libwrap.so.0 =&gt; /lib/libwrap.so.0 (0&#215;00978000)</p>
<p>@/etc/syslog.conf<br />
# The authpriv file has restricted access.<br />
authpriv.*                                              /var/log/secure</p>
<p>Configuration Files of TCP Wrapper</p>
<p>a. /etc/hosts.allow<br />
b. /etc/hosts.deny</p>
<p>The file names are quite self-explanatory.<br />
Access will be allowed when it matches an entry in the /etc/hosts.allow file<br />
Access will be denied when it matches an entry in the /etc/hosts.deny file</p>
<p>But take note of the rules or points to consider<br />
- access rules in hosts.allow are applied first<br />
- rules in each file are read from the top down, so take note the order of rules<br />
- changes in hosts.allow or hosts.deny will take effect immediately, no need to restart any services.<br />
- access to service is permitted if no rules are found in either file<br />
- use &#8216;#&#8217; character to insert comments<br />
- it uses this format</p>
<p>tcp_service : client_list [ : shell_command ]</p>
<p>where:<br />
tcp_server &#8211; daemon process names<br />
client_list &#8211; IP, hostnames, patterns, wildcards matching the client address or hostname</p>
<p>There are several patterns that you can use under client_list which we will not covering on this topic. But the recommended setting will be:<br />
Deny anything not explicitly allowed and only Allow certain services.</p>
<p>[root@freelinux~]# cat /etc/hosts.allow<br />
#<br />
# hosts.allow   This file describes the names of the hosts which are<br />
#               allowed to use the local INET services, as decided<br />
#               by the &#8216;/usr/sbin/tcpd&#8217; server.<br />
#<br />
ALL: ALL</p>
<p>[root@freelinux~]# cat /etc/hosts.allow<br />
#<br />
# hosts.allow   This file describes the names of the hosts which are<br />
#               allowed to use the local INET services, as decided<br />
#               by the &#8216;/usr/sbin/tcpd&#8217; server.<br />
#<br />
sshd : freelinuxtutorials.com : allow<br />
sshd: 192.168.0.192/255.255.255.240 : allow<br />
sshd : 192.168.0.100 : allow</p>
<p>12. <strong>Configure iptables for added SSH security</strong><br />
It&#8217;s good to have your servers protected by hardwares or appliances such as security appliances, PIX, ASA etc. that will added more protection such as limiting TCP connections esp. on preventing dictionary attacks.<br />
If you don&#8217;t have this, it&#8217;s a good thing this can be done also from your Linux server using iptables.</p>
<p>Sample iptables  to allow only specified host:<br />
iptables -A INPUT -p tcp -m state –state NEW –source 172.16.0.101 –dport 35286 -j ACCEPT</p>
<p>Another example iptables rule:</p>
<p>iptables -N RULE1<br />
iptables -A INPUT -p tcp –dport 35286 -m state –state NEW -j RULE1<br />
iptables -A RULE1 -m recent –set –name SSH<br />
iptables -A RULE1 -m recent –update –seconds 60 –hitcount 4 –name SSH -j DROP</p>
<p>where:<br />
Line1: create a new chaing RULE1<br />
Line2/3: allow incoming SSH connection on ssh port 35286 and it will pass through this chain<br />
Line4: source IP should not be more than 3 attempts within 60 seconds, else packets will be dropped from that source IP</p>
<p>13.  <strong>Use Strong Passwords</strong><br />
As system administrator, you can set a criteria for users to have a strong passwords. To enforce password complexity on  your Linux boxes via  PAM (the &#8220;pluggable authentication module&#8221;)</p>
<p>[root@freelinux~]# cat /etc/pam.d/system-auth | grep password<br />
password    requisite     pam_cracklib.so try_first_pass retry=3<br />
password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok<br />
password    required      pam_deny.so</p>
<p>Change to something like this:<br />
password requisite pam_cracklib.so try_first_pass retry=3 minlength=12 lcredit=1 ucredit=1 dcredit=1 ocredit=1 difok=4</p>
<p>where:</p>
<p>try_first_pass = sets the number of times a user can attempt to set a good password before it aborts<br />
minlen = measure of complexity related to the password length<br />
lcredit = minimum number of required lowercase letters<br />
ucredit = minimum number of required uppercase letters<br />
dcredit = minimum number of required digits<br />
ocredit = minimum number of required other characters<br />
difok = sets the number of characters that must be different from the previous passwords</p>
<p>Alternatively, you can use /etc/login.defs to set parameters such as password expiration, etc.<br />
@/etc/login.defs</p>
<p># Password aging controls:<br />
#<br />
#       PASS_MAX_DAYS   Maximum number of days a password may be used.<br />
#       PASS_MIN_DAYS   Minimum number of days allowed between password changes.<br />
#       PASS_MIN_LEN    Minimum acceptable password length.<br />
#       PASS_WARN_AGE   Number of days warning given before a password expires.<br />
#<br />
PASS_MAX_DAYS   99999<br />
PASS_MIN_DAYS   0<br />
PASS_MIN_LEN    5</p>
<p>14. <strong>Use Private/Public Keys for SSH authentication</strong><br />
If you decided not to do password authenticaton instead using of keys, then you can follow this <a title="SSH authentication via private public keys" href="http://freelinuxtutorials.com/tutorials/ssh-authentication-via-public-private-keys" target="_blank">tutorial</a>.</p>
<p>15. <strong>Patch OpenSSH to latest security fix</strong><br />
As long as you have the latest updates or patches installed on your Linux distribution, that should be enough to tell that you are fully patched.<br />
To check the changelog for the openssh rpm, use the command below. It will show you various patches</p>
<p>[root@freelinux~]# rpm -q &#8211;changelog openssh | more<br />
* Wed Jan 04 2012 Petr Lautrbach &lt;plautrba@redhat.com&gt; 4.3p2-82<br />
- improve RNG seeding from /dev/random (#681291,#708056)</p>
<p>* Fri Dec 02 2011 Petr Lautrbach &lt;plautrba@redhat.com&gt; 4.3p2-81<br />
- make ssh(1)&#8217;s ConnectTimeout option apply to both the TCP connection and<br />
SSH banner exchange (#750725)</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffreelinuxtutorials.com%2Ftutorials%2Fsecuring-your-openssh-server%2F&amp;title=Securing%20your%20OpenSSH%20server%20in%20Linux" id="wpa2a_8"><img src="http://freelinuxtutorials.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a href="http://freelinuxtutorials.com/tutorials/securing-your-openssh-server/">Securing your OpenSSH server in Linux</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelinuxtutorials.com/tutorials/securing-your-openssh-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configure Centralized Syslog server in Linux &amp; setup syslog clients on different platforms</title>
		<link>http://freelinuxtutorials.com/tutorials/configure-centralized-syslog-server-in-linux-setup-syslog-clients-on-different-platforms/</link>
		<comments>http://freelinuxtutorials.com/tutorials/configure-centralized-syslog-server-in-linux-setup-syslog-clients-on-different-platforms/#comments</comments>
		<pubDate>Thu, 11 Oct 2012 13:43:11 +0000</pubDate>
		<dc:creator>Free Linux Tutorials</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[juniper]]></category>
		<category><![CDATA[syslog]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://freelinuxtutorials.com/?p=468</guid>
		<description><![CDATA[<p>Linux comes with a built-in syslog package that you can use as a centralized syslog server. Basically, it can be used to send all log files from your network devices or appliances in a remote and centralized location. There are also some popular syslog packages for Linux that you can use  such as syslog-ng,rsyslog &#38; [...]</p><p>The post <a href="http://freelinuxtutorials.com/tutorials/configure-centralized-syslog-server-in-linux-setup-syslog-clients-on-different-platforms/">Configure Centralized Syslog server in Linux &#038; setup syslog clients on different platforms</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Linux comes with a built-in syslog package that you can use as a centralized syslog server. Basically, it can be used to send all log files from your network devices or appliances in a remote and centralized location. There are also some popular syslog packages for Linux that you can use  such as syslog-ng,rsyslog &amp; splunk syslog server which all offers more features and flexibility.</p>
<p>On this tutorial, we are going to use the syslogd/sysklogd server which is a multi-platform and proven stable software.</p>
<p>[Syslog Server]</p>
<p>1.verify if the sysklogd package is installed.</p>
<p>[root@freelinux ~]# rpm -qa | grep sysklogd<br />
sysklogd-1.4.1-46.el5</p>
<p>2. start the syslog daemon</p>
<p>[root@freelinux ~]# service syslog start<br />
Starting system logger: [  OK  ]<br />
Starting kernel logger: [  OK  ]</p>
<p>3. verify if the process is running</p>
<p>[root@freelinux ~]# ps -ef | grep syslog<br />
root      2174     1  0 17:53 ?        00:00:00 syslogd -m 0<br />
root      2180  2110  0 17:54 pts/1    00:00:00 grep syslog<br />
[root@freelinux ~]# ls -la /var/run | grep syslog<br />
-rw&#8212;&#8212;-  1 root  root     5 Oct  9 17:53 syslogd.pid</p>
<p>4. configure the syslog</p>
<p>configuration files:<br />
/etc/sysconfig/syslog<br />
/etc/syslog.conf</p>
<p>Add the &#8220;-r&#8221; options to enable logging from the remote machines</p>
<p>[root@freelinux ~]# cat /etc/sysconfig/syslog<br />
# Options to syslogd<br />
# -m 0 disables &#8216;MARK&#8217; messages.<br />
# -r enables logging from remote machines<br />
# -x disables DNS lookups on messages recieved with -r<br />
# See syslogd(8) for more details<br />
SYSLOGD_OPTIONS=&#8221;<strong>-r</strong> -m 0&#8243;<br />
# Options to klogd<br />
# -2 prints all kernel oops messages twice; once for klogd to decode, and<br />
#    once for processing with &#8216;ksymoops&#8217;<br />
# -x disables all klogd processing of oops messages entirely<br />
# See klogd(8) for more details<br />
KLOGD_OPTIONS=&#8221;-x&#8221;<br />
#<br />
SYSLOG_UMASK=077<br />
# set this to a umask value to use for all log files as in umask(1).<br />
# By default, all permissions are removed for &#8220;group&#8221; and &#8220;other&#8221;.</p>
<p>5. Restart the syslog service</p>
<p>[root@freelinux ~]# service syslog restart<br />
Shutting down kernel logger: [  OK  ]<br />
Shutting down system logger: [  OK  ]<br />
Starting system logger: [  OK  ]<br />
Starting kernel logger: [  OK  ]</p>
<p>[Client devices]</p>
<p>configuration file: /etc/syslog.conf</p>
<p>a. Linux servers</p>
<p>[root@freelinux ~]# cat /etc/syslog.conf<br />
# Log all kernel messages to the console.<br />
# Logging much else clutters up the screen.<br />
#kern.*                                                 /dev/console</p>
<p>*.* @172.16.0.100</p>
<p># Log anything (except mail) of level info or higher.<br />
# Don&#8217;t log private authentication messages!<br />
*.info;mail.none;authpriv.none;cron.none                /var/log/messages</p>
<p># The authpriv file has restricted access.<br />
authpriv.*                                              /var/log/secure</p>
<p># Log all the mail messages in one place.<br />
mail.*                                                  -/var/log/maillog</p>
<p># Log cron stuff<br />
cron.*                                                  /var/log/cron</p>
<p># Everybody gets emergency messages<br />
*.emerg                                                 *</p>
<p># Save news errors of level crit and higher in a special file.<br />
uucp,news.crit                                          /var/log/spooler</p>
<p># Save boot messages also to boot.log<br />
local7.*                                                /var/log/boot.log</p>
<p>b. Cisco/Motorola devices</p>
<p>Cisco#configure terminal<br />
Cisco#logging facility local6<br />
Cisco#logging 172.16.0.49</p>
<p>c. Juniper OS<br />
darwin@Juniper&gt; configure<br />
Entering configuration mode</p>
<p>{master}[edit]<br />
darwin@Juniper#<br />
darwin@Juniper#  set system syslog host a.a.a.a facility-override local6 any any<br />
darwin@Juniper#commit synch</p>
<p>darwin@Juniper#show configuration</p>
<p>host 172.16.0.100 {<br />
any any;<br />
facility-override local6;<br />
}</p>
<p>d. Unix</p>
<p># @(#)B.11.11_LR<br />
#<br />
# syslogd configuration file.<br />
#<br />
# See syslogd(1M) for information about the format of this file.<br />
#<br />
mail.debug              /var/adm/syslog/mail.log<br />
*.info;mail.none;local1.none;local2.none;local5.none;local6.none;local7.none    /var/adm/syslog/syslog.log<br />
*.alert                 /dev/console<br />
#*.alert                        root<br />
*.emerg                 *<br />
local4.info             /var/adm/syslog/fw.log<br />
local6.info             /var/adm/syslog/cisco.log</p>
<p>e. Windows</p>
<p>There&#8217;s no way to directly configure the syslog clients or send your event log messages to syslog server. You have to use syslog clients such as Snare &amp; winlogd which I will not cover on this tutorial. Alternative way, is send your event logs as snmp traps by configuring your SNMP service &amp; using the event to trap translator or &#8220;evntwin&#8221; command.</p>
<p><em>Additional Tips:</em></p>
<p>1. To make syslogd, re-read its configuration file, send it a HANGUP  signal:<br />
[root@freelinux ~]# kill -HUP `cat /var/run/syslog.pid`</p>
<p>2. Familiarize with syslog facility and severity levels. A good reference about this is Wiki http://en.wikipedia.org/wiki/Syslog. Sample syslog.conf is on the Config-Scripts Section to show how this will be very useful for system administrators.</p>
<p>3.You can verify messages if it&#8217;s being logged in your syslog or if you want to test your /etc/syslog.conf, you can use the &#8220;logger&#8221; command</p>
<p>e.g.<br />
@/etc/syslog.conf<br />
*.info;mail.none;authpriv.none;cron.none                /var/log/messages</p>
<p>[root@freelinux ~]# logger -p user.info &#8220;Test Message&#8221;<br />
[root@freelinux ~]# tail /var/log/messages<br />
Oct 11 21:25:39 localhost root: Test Message</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffreelinuxtutorials.com%2Ftutorials%2Fconfigure-centralized-syslog-server-in-linux-setup-syslog-clients-on-different-platforms%2F&amp;title=Configure%20Centralized%20Syslog%20server%20in%20Linux%20%26%20setup%20syslog%20clients%20on%20different%20platforms" id="wpa2a_10"><img src="http://freelinuxtutorials.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a href="http://freelinuxtutorials.com/tutorials/configure-centralized-syslog-server-in-linux-setup-syslog-clients-on-different-platforms/">Configure Centralized Syslog server in Linux &#038; setup syslog clients on different platforms</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelinuxtutorials.com/tutorials/configure-centralized-syslog-server-in-linux-setup-syslog-clients-on-different-platforms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Use tcpdump in Linux to capture network packets and view in wireshark</title>
		<link>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-use-tcpdump-in-linux-to-capture-network-packets-and-view-in-wireshark/</link>
		<comments>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-use-tcpdump-in-linux-to-capture-network-packets-and-view-in-wireshark/#comments</comments>
		<pubDate>Mon, 24 Sep 2012 07:03:21 +0000</pubDate>
		<dc:creator>Free Linux Tutorials</dc:creator>
				<category><![CDATA[Quick Tips & Tricks]]></category>

		<guid isPermaLink="false">http://freelinuxtutorials.com/?p=448</guid>
		<description><![CDATA[<p>Important note to remember: a. capture it in full length, using the -s 0 options b. save it in a file, better to make the extension as .pcap so wireshark can associate directly 1.Identify which interface you want to listen to [root@freelinux tmp]# ifconfig eth0 Link encap:Ethernet HWaddr 08:00:27:72:24:E6 inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: [...]</p><p>The post <a href="http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-use-tcpdump-in-linux-to-capture-network-packets-and-view-in-wireshark/">Quick Tip: Use tcpdump in Linux to capture network packets and view in wireshark</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Important note to remember:<br />
a. capture it in full length, using the -s 0 options<br />
b. save it in a file, better to make the extension as .pcap so wireshark can associate directly</p>
<p>1.Identify which interface you want to listen to</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 320px; height: 20px; text-align: left;" dir="ltr">
[root@freelinux tmp]# <strong>ifconfig </strong></pre>
<p>eth0      Link encap:Ethernet  HWaddr 08:00:27:72:24:E6<br />
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0<br />
          inet6 addr: fe80::a00:27ff:fe72:24e6/64 Scope:Link<br />
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
          RX packets:942 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:612 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:1000<br />
          RX bytes:78095 (76.2 KiB)  TX bytes:198882 (194.2 KiB)<br />
          Interrupt:10 Base address:0xd020 </p>
<p>2. Run &#8220;tcpdump&#8221; command with the following options. For instance, you want to monitor the DNS packets.Run:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 500px; height: 20px; text-align: left;" dir="ltr">
<strong>tcpdump -ni eth0 -Xvvv -w freelinux.pcap -s 0 port 53</strong> </pre>
<p>[root@freelinux tmp]# tcpdump -ni eth0 -Xvvv -w freelinux.pcap -s 0 port 53<br />
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes<br />
2657 packets captured<br />
2938 packets received by filter<br />
0 packets dropped by kernel </p>
<p>Verify:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 500px; height: 40px; text-align: left;" dir="ltr">
# ls -l /tmp
-rw-r--r-- 1 root wheel 1386926 Sep 24 14:39 freelinux.pcap</pre>
<p>where as:</p>
<p>-s 0  &#8211;> capture byte to its maximum (65535) or it&#8217;s full lenght<br />
-ni &#8211;> listen on which interface. Then -n option is used so not to convert host addresses to names.<br />
-w &#8211;> create the file<br />
port &#8211;> to indicate the port number, e.g. 53 which pertains to dns<br />
-X &#8211;> Print each packet (minus its link level header) in hex  and  ASCII<br />
-vvv &#8211;>  Even more verbose output</p>
<p>Other samples:<br />
[root@freelinux tmp]# tcpdump -ni eth0 -Xvvv -w freelinux.pcap -s 0 portrange 67-68<br />
[root@freelinux tmp]# tcpdump -ni eth1 -s0 -w hostlinux.pcap host 8.8.8.8 &#038;</p>
<p>Note: you can do Ctrl+C to terminate the task, or if run in background, kill the process if finished as it will consume some hard disk space and some CPU resources.</p>
<p>3. Now open the wireshark program. It&#8217;s a GUI-based program, so viewing is easier and flexible.</p>
<p>Enjoy!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffreelinuxtutorials.com%2Fquick-tips-and-tricks%2Fquick-tip-use-tcpdump-in-linux-to-capture-network-packets-and-view-in-wireshark%2F&amp;title=Quick%20Tip%3A%20Use%20tcpdump%20in%20Linux%20to%20capture%20network%20packets%20and%20view%20in%20wireshark" id="wpa2a_12"><img src="http://freelinuxtutorials.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a href="http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-use-tcpdump-in-linux-to-capture-network-packets-and-view-in-wireshark/">Quick Tip: Use tcpdump in Linux to capture network packets and view in wireshark</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-use-tcpdump-in-linux-to-capture-network-packets-and-view-in-wireshark/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quick tip: Change Timezone in Linux in different ways</title>
		<link>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-change-timezone-in-linux-in-different-ways/</link>
		<comments>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-change-timezone-in-linux-in-different-ways/#comments</comments>
		<pubDate>Thu, 20 Sep 2012 15:47:34 +0000</pubDate>
		<dc:creator>Free Linux Tutorials</dc:creator>
				<category><![CDATA[Quick Tips & Tricks]]></category>

		<guid isPermaLink="false">http://freelinuxtutorials.com/?p=427</guid>
		<description><![CDATA[<p>There is some instance during the Linux installation that you did not bother to set the correct timezone for any reasons like sometimes you are just lazy to set it, you&#8217;re in a rush to finish what your boss want you to complete in that day, or you just don&#8217;t give a damn Seriously, timezone [...]</p><p>The post <a href="http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-change-timezone-in-linux-in-different-ways/">Quick tip: Change Timezone in Linux in different ways</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>There is some instance during the Linux installation that you did not bother to set the correct timezone for any reasons like sometimes you are just lazy to set it, you&#8217;re in a rush to finish what your boss want you to complete in that day, or you just don&#8217;t give a damn <img src='http://freelinuxtutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Seriously, timezone is a bit important especially if you have scheduled scripts that you intended to run.</p>
<p>Here are some ways to change your timezone depending on your Linux distribution:</p>
<p>for RHEL/CENTOS:</p>
<p>Assuming you have the default or current timezone as UTC and you would like to change it to Singapore timezone</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 400px; height: 45px; text-align: left;" dir="ltr">
[root@freelinux etc]# <strong>date</strong>
Thu Sep 6 23:15:06 UTC 2012 
[root@freelinux etc]#<strong> rm /etc/localtime</strong></pre>
<p>Note: All timezones can be found under the directory <strong>/usr/share/zoneinfo</strong></p>
<p>Link the Singapore file under the Asia to the /etc/localtime</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 420px; height: 75px; text-align: left;" dir="ltr">
#cd /etc
#ln -s /usr/share/zoneinfo/Asia/Singapore localtime
#date
Fri Sep 7 07:17:20 SGT 2012 </pre>
<p>This localtime symbolic links can be overwritten when you execute tzdata-update which will based from /etc/sysconfig/clock settings configured</p>
<p>Example:<br />
current date in Singapore time, you execute the tzdata-update, it will read the /etc/sysconfig/clock file</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 400px; height: 135px; text-align: left;" dir="ltr">
[root@freelinux etc]# <strong>cat /etc/sysconfig/clock</strong>
ZONE="Asia/Seoul"
UTC=true
ARC=false
[root@freelinux etc]# date
Fri Sep 7 07:26:12 SGT 2012
[root@freelinux etc]# <strong>tzdata-update</strong>
[root@freelinux etc]# date
Fri Sep 7 08:26:20 KST 2012
</pre>
<p>For Ubuntu/Debian, the above method will also work. But it also has some commands to make you life easier, see items 1 &amp; 2</p>
<p>1. A simple way to change your timezone is using the &#8220;tzconfig&#8221; command which will prompt you with a list of region and cities. It will a simple way to update the link /etc/localtime to point to the correct timezone in /usr/share/zoneinfo</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 400px; height: 15px; text-align: left;" dir="ltr">
[root@freelinux etc]# <strong>tzconfig</strong></pre>
<p>2.Another way is using the command &#8220;dpkg-reconfigure tzdata&#8221;. It will be a menu-based type of configuration screen.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 400px; height: 15px; text-align: left;" dir="ltr">
[root@freelinux etc]# <strong>dpkg-reconfigure tzdata</strong></pre>
<p>3. Another method which will work with other distribution as well is via the TZ environment variable</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 400px; height: 90px; text-align: left;" dir="ltr">
[root@freelinux ~]# date
Fri Sep 7 07:46:09 SGT 2012
[root@freelinux ~]# <strong>export TZ=Asia/Manila</strong>
[root@freelinux ~]# date
Fri Sep 7 07:46:30 PHT 2012 </pre>
<p>4. Another way is via &#8220;tzselect&#8221; command</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 400px; height: 15px; text-align: left;" dir="ltr">
[root@freelinux ~]# <strong>tzselect </strong></pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffreelinuxtutorials.com%2Fquick-tips-and-tricks%2Fquick-tip-change-timezone-in-linux-in-different-ways%2F&amp;title=Quick%20tip%3A%20Change%20Timezone%20in%20Linux%20in%20different%20ways" id="wpa2a_14"><img src="http://freelinuxtutorials.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a href="http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-change-timezone-in-linux-in-different-ways/">Quick tip: Change Timezone in Linux in different ways</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-change-timezone-in-linux-in-different-ways/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick tip: Set date and time in Linux</title>
		<link>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-set-date-and-time-in-linux/</link>
		<comments>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-set-date-and-time-in-linux/#comments</comments>
		<pubDate>Thu, 20 Sep 2012 14:38:15 +0000</pubDate>
		<dc:creator>Free Linux Tutorials</dc:creator>
				<category><![CDATA[Quick Tips & Tricks]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[hwclock]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://freelinuxtutorials.com/?p=417</guid>
		<description><![CDATA[<p>There are few ways to set the date and time on Linux command line. In order to do this, you must login as root and execute the following methods as follow: For you to remember the syntax, issue the command &#8220;date&#8221; first [root@freelinux ~]# date Mon Aug 20 18:30:29 SGT 2012 Let say you want [...]</p><p>The post <a href="http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-set-date-and-time-in-linux/">Quick tip: Set date and time in Linux</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>There are few ways to set the date and time on Linux command line. In order to do this, you must login as root and execute the following methods as follow:</p>
<p>For you to remember the syntax, issue the command &#8220;date&#8221; first</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 320px; height: 30px; text-align: left;" dir="ltr">
[root@freelinux ~]# <strong>date </strong>
Mon Aug 20 18:30:29 SGT 2012</pre>
<p>Let say you want to change it to Sept 6, 2012, 3pm, just follow the pattern above</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 320px; height: 30px; text-align: left;" dir="ltr">
[root@freelinux ~]# <strong>date 090615002012</strong>
Thu Sep  6 15:00:00 SGT 2012</pre>
<p>where as:<br />
09 = month (September)<br />
06 = day<br />
15 = hour<br />
00 = min<br />
2012 = year</p>
<p>Now it&#8217;s set, as simple as that:<br />
[root@freelinux ~]# date<br />
Thu Sep  6 15:00:01 SGT 2012</p>
<p>Another example, you want it to change to 20th of December, 2012, 10:45pm</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 320px; height: 30px; text-align: left;" dir="ltr">
[root@freelinux ~]# <strong>date 122022452012</strong>
Thu Dec 20 22:45:00 SGT 2012</pre>
<p>Viola!!!</p>
<p>[root@freelinux ~]# date<br />
Thu Dec 20 22:45:03 SGT 2012</p>
<p>Now if you want to challenge yourself, then you can use this as well:<br />
Using our example date above, use the date command with &#8211;set or -s options</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 400px; height: 30px; text-align: left;" dir="ltr">
[root@freelinux ~]# <strong>date -s "6 Sept 2012 15:00:00"</strong>
Thu Sep  6 15:00:00 SGT 2012</pre>
<p>Extra tip: To set the hardware clock to the current system time, use:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 320px; height: 15px; text-align: left;" dir="ltr">
[root@freelinux ~]# <strong>hwclock  --systohc</strong></pre>
<p>If the other way around, to set the system time from the hardware clock</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 320px; height: 15px; text-align: left;" dir="ltr">
[root@freelinux ~]# <strong>hwclock --hctosys</strong></pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffreelinuxtutorials.com%2Fquick-tips-and-tricks%2Fquick-tip-set-date-and-time-in-linux%2F&amp;title=Quick%20tip%3A%20Set%20date%20and%20time%20in%20Linux" id="wpa2a_16"><img src="http://freelinuxtutorials.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a href="http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-set-date-and-time-in-linux/">Quick tip: Set date and time in Linux</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-set-date-and-time-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install and Configure SNMP client on Linux</title>
		<link>http://freelinuxtutorials.com/tutorials/install-and-configure-snmp-client-on-linux/</link>
		<comments>http://freelinuxtutorials.com/tutorials/install-and-configure-snmp-client-on-linux/#comments</comments>
		<pubDate>Tue, 11 Sep 2012 09:06:43 +0000</pubDate>
		<dc:creator>Free Linux Tutorials</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[MIB]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[snmpd]]></category>
		<category><![CDATA[snmpd.conf]]></category>
		<category><![CDATA[snmpwalk]]></category>

		<guid isPermaLink="false">http://freelinuxtutorials.com/?p=410</guid>
		<description><![CDATA[<p>The following procedure will install and configure snmp daemon on your Redhat-based distribution such as CentOS &#38; Fedora. Here are the steps: 1. Verify if snmp package is installed, there are few ways [root@localhost ~]# rpm -qa &#124; grep snmp [root@localhost ~]# snmpwalk -bash: snmpwalk: command not found [root@localhost ~]# ls /etc/snmp* ls: /etc/snmp*: No [...]</p><p>The post <a href="http://freelinuxtutorials.com/tutorials/install-and-configure-snmp-client-on-linux/">Install and Configure SNMP client on Linux</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>The following procedure will install and configure snmp daemon on your Redhat-based distribution such as CentOS &amp; Fedora. Here are the steps:</p>
<p>1. Verify if snmp package is installed, there are few ways</p>
<p>[root@localhost ~]# rpm -qa | grep snmp</p>
<p>[root@localhost ~]# snmpwalk<br />
-bash: snmpwalk: command not found</p>
<p>[root@localhost ~]# ls /etc/snmp*<br />
ls: /etc/snmp*: No such file or directory</p>
<p>This mean net-snmp package is not installed yet</p>
<p>2. Install net-snmp &amp; net-snmp-utils package via yum or up2date</p>
<p>CentOS/Fedora:<br />
[root@localhost ~]# yum install net-snmp net-snmp-utils<br />
Loaded plugins: fastestmirror, security<br />
Loading mirror speeds from cached hostfile<br />
* base: mirror.usonyx.net<br />
* extras: mirror.usonyx.net<br />
* updates: mirror.usonyx.net<br />
Setting up Install Process<br />
Resolving Dependencies<br />
–&gt; Running transaction check<br />
—&gt; Package net-snmp.i386 1:5.3.2.2-17.el5_8.1 set to be updated<br />
–&gt; Processing Dependency: libsensors.so.3 for package: net-snmp<br />
—&gt; Package net-snmp-utils.i386 1:5.3.2.2-17.el5_8.1 set to be updated<br />
–&gt; Running transaction check<br />
—&gt; Package lm_sensors.i386 0:2.10.7-9.el5 set to be updated<br />
–&gt; Finished Dependency Resolution</p>
<p>Dependencies Resolved</p>
<p>================================================================================<br />
Package              Arch       Version                    Repository     Size<br />
================================================================================<br />
Installing:<br />
net-snmp             i386       1:5.3.2.2-17.el5_8.1       updates       703 k<br />
net-snmp-utils       i386       1:5.3.2.2-17.el5_8.1       updates       191 k<br />
Installing for dependencies:<br />
lm_sensors           i386       2.10.7-9.el5               base          511 k</p>
<p>Transaction Summary<br />
================================================================================<br />
Install       3 Package(s)<br />
Upgrade       0 Package(s)</p>
<p>Total download size: 1.4 M<br />
Is this ok [y/N]: y<br />
Downloading Packages:<br />
(1/3): net-snmp-utils-5.3.2.2-17.el5_8.1.i386.rpm        | 191 kB     00:00<br />
(2/3): lm_sensors-2.10.7-9.el5.i386.rpm                  | 511 kB     00:01<br />
(3/3): net-snmp-5.3.2.2-17.el5_8.1.i386.rpm              | 703 kB     00:01<br />
——————————————————————————–<br />
Total                                           408 kB/s | 1.4 MB     00:03<br />
Running rpm_check_debug<br />
Running Transaction Test<br />
Finished Transaction Test<br />
Transaction Test Succeeded<br />
Running Transaction<br />
Installing     : lm_sensors                                               1/3<br />
Installing     : net-snmp                                                 2/3<br />
Installing     : net-snmp-utils                                           3/3</p>
<p>Installed:<br />
net-snmp.i386 1:5.3.2.2-17.el5_8.1  net-snmp-utils.i386 1:5.3.2.2-17.el5_8.1</p>
<p>Dependency Installed:<br />
lm_sensors.i386 0:2.10.7-9.el5</p>
<p>Complete!</p>
<p>RHEL:<br />
up2date -v -i net-snmp-utils net-snmp</p>
<p>3. Configure /etc/snmp/snmpd.conf, basic config would be specifying the community string. You can use any text editor like vi or use echo command</p>
<p>[root@localhost ~]# echo rocommunity freelinuxtutorials &gt;&gt; /etc/snmp/snmpd.conf</p>
<p>4. Restart snmp service</p>
<p>[root@localhost ~]# service snmpd restart<br />
Stopping snmpd: [FAILED]<br />
Starting snmpd: [  OK  ]</p>
<p>5. Check snmpd if it’s working using snmp utilities like snmpwalk. You should get an output something like this:</p>
<p>[root@localhost ~]# snmpwalk -v2c -c freelinuxtutorials localhost<br />
SNMPv2-MIB::sysDescr.0 = STRING: Linux localhost.localdomain 2.6.18-308.13.1.el5 #1 SMP Tue Aug 21 17:10:06 EDT 2012 i686<br />
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10<br />
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (356) 0:00:03.56</p>
<p>Quick tip:</p>
<p>To make sure snmpd will start on boot, use chkconfig command<br />
Sample:<br />
[root@localhost init.d]# ls -l /etc/rc3.d/ | grep snmpd<br />
lrwxrwxrwx 1 root root 15 Aug 29 15:56 K50snmpd -&gt; ../init.d/snmpd</p>
<p>[root@localhost init.d]# chkconfig snmpd on<br />
[root@localhost init.d]# ls -l /etc/rc3.d/ | grep snmpd<br />
lrwxrwxrwx 1 root root 15 Aug 29 15:57 S50snmpd -&gt; ../init.d/sn</p>
<p>Notice snmpd changed from K50 to S50, meaning snmpd will start on boot. Enjoy!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffreelinuxtutorials.com%2Ftutorials%2Finstall-and-configure-snmp-client-on-linux%2F&amp;title=Install%20and%20Configure%20SNMP%20client%20on%20Linux" id="wpa2a_18"><img src="http://freelinuxtutorials.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a href="http://freelinuxtutorials.com/tutorials/install-and-configure-snmp-client-on-linux/">Install and Configure SNMP client on Linux</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelinuxtutorials.com/tutorials/install-and-configure-snmp-client-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick tip: how to connect linux php applications to MSSQL via freetds</title>
		<link>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-how-to-connect-linux-php-applications-to-mssql-via-freetds/</link>
		<comments>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-how-to-connect-linux-php-applications-to-mssql-via-freetds/#comments</comments>
		<pubDate>Tue, 11 Sep 2012 09:00:09 +0000</pubDate>
		<dc:creator>Free Linux Tutorials</dc:creator>
				<category><![CDATA[Quick Tips & Tricks]]></category>

		<guid isPermaLink="false">http://freelinuxtutorials.com/?p=407</guid>
		<description><![CDATA[<p>Here’s one trick to do that: Step 1. Install  FreeTDS FreeTDS Website: http://www.freetds.org/ choose FreeTDS source distribution Compile parameter: –prefix=/usr/local/freetds –enable-msdblib Then, copy /etc/ld.so.conf, to /usr/local/freetds/lib; and then run ldconfig Step 2. Change /usr/local/freetds/etc/freetds.conf [sql2k] host = your.mssql.server.ip port = 1433 client charset = cp950 tds version = 8.0 b. tds version: 4.2 (for MS [...]</p><p>The post <a href="http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-how-to-connect-linux-php-applications-to-mssql-via-freetds/">Quick tip: how to connect linux php applications to MSSQL via freetds</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Here’s one trick to do that:<br />
Step 1. Install  FreeTDS</p>
<p>FreeTDS Website: http://www.freetds.org/ choose FreeTDS source distribution</p>
<p>Compile parameter: –prefix=/usr/local/freetds –enable-msdblib</p>
<p>Then, copy /etc/ld.so.conf, to /usr/local/freetds/lib; and then run ldconfig</p>
<p>Step 2. Change /usr/local/freetds/etc/freetds.conf</p>
<p>[sql2k]</p>
<p>host = your.mssql.server.ip<br />
port = 1433<br />
client charset = cp950<br />
tds version = 8.0</p>
<p>b. tds version: 4.2 (for MS SQL Server 6.x); 7.0 (for 7.x); 8.0 (for 2000)</p>
<p>Step 3. Test FreeTDS connect to MS SQL Server</p>
<p>#cd /usr/local/freetds/bin<br />
#./tsql -S sql2k -U sa<br />
1&gt; use mydatabase<br />
2&gt; select * from mytable<br />
3&gt; go</p>
<p>it shows mytable if success</p>
<p>quit tsql:</p>
<p>1&gt;    quit</p>
<p>Step 4. Recompile PHP Source</p>
<p>PHP website: http://www.php.net/</p>
<p>Before you re compile, please use php run echo phpinfo(); check the existing configure parameter, and then add  –with-mssql=/usr/local/freetds</p>
<p>example:</p>
<p>./configure ‘–prefix=/usr/local/php_4.3.10&#8242; ‘–localstatedir=/var’ ‘–disable-debug’ ‘–enable-pic’ ‘–disable-rpath’ ‘–enable-inline-<br />
optimization’ ‘–with-bz2&#8242; ‘–with-db4=/usr’ ‘–with-curl’ ‘–with-exec-dir=/usr/bin’ ‘–with-freetype-dir=/usr’ ‘–with-png-dir=/usr’ ‘–with-gd’ ‘–enable-gd-native-ttf’ ‘–without-gdbm’ ‘–with-gettext’ ‘–with-ncurses’ ‘–with-gmp’ ‘–with-iconv’ ‘–with-jpeg-dir=/usr’ ‘–with-<br />
openssl’ ‘–with-png’ ‘–with-pspell’ ‘–with-regex=system’ ‘–with-xml’ ‘–with-expat-dir=/usr’ ‘–with-dom’ ‘–with-dom-xslt=/usr’ ‘–with-dom-exslt=/usr’ ‘–with-xmlrpc=shared’ ‘–with-pcre-<br />
regex=/usr’ ‘–with-zlib’ ‘–with-layout=GNU’ ‘–enable-bcmath’ ‘–enable-exif’ ‘–enable-ftp’ ‘–enable-magic-quotes’ ‘–enable-safe-mode’ ‘–enable-sockets’ ‘–enable-sysvsem’ ‘–enable-sysvshm’ ‘–enable-track-vars’ ‘–enable-trans-sid’ ‘–enable-yp’ ‘–enable-wddx’ ‘–with-pear=/usr/share/pear’ ‘–with-imap=shared’ ‘–with-imap-ssl’ ‘–with-kerberos’ ‘–with-ldap=shared’ ‘–with-mysql’ ‘–with- pgsql=shared’ ‘–with-snmp’ ‘–with-snmp=shared’ ‘–enable-ucd-snmp-hack’ ‘–with-unixODBC’ ‘–enable-memory-limit’ ‘–enable-bcmath’ ‘–enable-shmop’ ‘–enable-calendar’ ‘–enable-dbx’ ‘– enable-dio’ ‘–enable-mcal’ ‘–enable-mbstring’ ‘–enable-mbstr-enc-trans’ ‘–enable-mbregex’ ‘–with-apxs2=/usr/sbin/apxs’ ‘–with-mssql=/usr/local/freetds’</p>
<p>After compile?installation, cp php.ini-dist /prefix/lib/php.ini</p>
<p>Step 5. Startup Apache HTTP Server for testing</p>
<p>Sample Code:</p>
<p>&lt;?php</p>
<p>mssql_connect(‘sql2k’,&#8217;sa’,”);<br />
mssql_select_db(‘mydatabase’);<br />
$rs = mssql_query(‘select * from mytable’);<br />
list($column01) = mssql_fetch_row($rs);<br />
echo $column01;<br />
?&gt;</p>
<p>It show mytable if success.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffreelinuxtutorials.com%2Fquick-tips-and-tricks%2Fquick-tip-how-to-connect-linux-php-applications-to-mssql-via-freetds%2F&amp;title=Quick%20tip%3A%20how%20to%20connect%20linux%20php%20applications%20to%20MSSQL%20via%20freetds" id="wpa2a_20"><img src="http://freelinuxtutorials.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a href="http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-how-to-connect-linux-php-applications-to-mssql-via-freetds/">Quick tip: how to connect linux php applications to MSSQL via freetds</a> appeared first on <a href="http://freelinuxtutorials.com">Free Linux Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://freelinuxtutorials.com/quick-tips-and-tricks/quick-tip-how-to-connect-linux-php-applications-to-mssql-via-freetds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
