<?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>Sebastian Mogilowskis Blog &#187; ssh</title>
	<atom:link href="http://www.mogilowski.net/lang/en-us/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mogilowski.net</link>
	<description>Just another blog about administration, linux and other stuff</description>
	<lastBuildDate>Thu, 26 Apr 2012 06:44:10 +0000</lastBuildDate>
	<language>en-us</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Monitoring an Coldfusion server with Cacti</title>
		<link>http://www.mogilowski.net/lang/en-us/2008/07/02/monitoring-an-coldfusion-server-with-cacti</link>
		<comments>http://www.mogilowski.net/lang/en-us/2008/07/02/monitoring-an-coldfusion-server-with-cacti#comments</comments>
		<pubDate>Wed, 02 Jul 2008 08:49:44 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[cfstat]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.mogilowski.net/?p=30&#038;lang=en-us</guid>
		<description><![CDATA[I don&#8217;t found a coldfusion template for Cacti so i created one. It uses cfstat. I use Cacti and coldfusion on Debian Linux. First you need a script to call the cfstat command on the coldfusion server: #!/bin/bash # This script call the coldfusion server stat service and format the output for cacti # 2008 [...]]]></description>
			<content:encoded><![CDATA[<p><span lang="en-us">I don&#8217;t found a coldfusion template for <a title="Cacti" href="http://www.cacti.net" target="_blank">Cacti</a> so i created one. It uses <em>cfstat</em>. I use <a title="Cacti" href="http://www.cacti.net" target="_blank">Cacti</a> and coldfusion on Debian Linux.</span></p>
<p><span lang="en-us">First you need a script to call the <em>cfstat</em> command on the coldfusion server:</span></p>
<pre>
#!/bin/bash

# This script call the coldfusion server stat service and format the output for cacti
# 2008 by Mogilowski Sebastian

# Settings:
HOSTNAME='127.0.0.1'
SSH_USER='username'
SSH_KEY_FILE='/path/to/ssh/key/file'
# Check argument
if [ $# -ne 1 ]
then
  echo "Usage: `basename $0` &#60;hostname&#62;"
  exit $E_BADARGS
fi

# Using command line argument 1 for hostname
HOSTNAME=$1

# Request statistics from the coldfusion stat service
STAT_OUTPUT=`ssh -i $SSH_KEY_FILE $SSH_USER@$HOSTNAME /opt/coldfusion8/bin/cfstat -n -x`

# Format the output for cacti
IFS=" "
ARRAY_OUTPUT=($STAT_OUTPUT)
echo "Pg/Sec_Now:"${ARRAY_OUTPUT[0]}" Pg/Sec_Hi:"${ARRAY_OUTPUT[1]}"
      DB/Sec_Now:"${ARRAY_OUTPUT[2]}" DB/Sec_Hi:"${ARRAY_OUTPUT[3]}"
      CP/Sec_Now:"${ARRAY_OUTPUT[4]}" CP/Sec_Hi:"${ARRAY_OUTPUT[4]}"
      Reqs_Qed:"${ARRAY_OUTPUT[6]}" Reqs_Rung:"${ARRAY_OUTPUT[7]}"
      Reqs_TOed:"${ARRAY_OUTPUT[8]}" Templ_Qed:"${ARRAY_OUTPUT[9]}"
      Templ_Rung:"${ARRAY_OUTPUT[10]}" Templ_TOed:"${ARRAY_OUTPUT[11]}"
      Flash_Qed:"${ARRAY_OUTPUT[12]}" Flash_Rung:"${ARRAY_OUTPUT[13]}"
      Flash_TOed:"${ARRAY_OUTPUT[14]}" CFC_Qed:"${ARRAY_OUTPUT[15]}"
      CFC_Rung:"${ARRAY_OUTPUT[16]}" CFC_TOed:"${ARRAY_OUTPUT[17]}"
      WebS_Qed:"${ARRAY_OUTPUT[18]}" WebS_Rung:"${ARRAY_OUTPUT[19]}"
      WebS_TOed:"${ARRAY_OUTPUT[20]}" AvgQ_time:"${ARRAY_OUTPUT[21]}"
      AvgReq_Time:"${ARRAY_OUTPUT[22]}" AvgDB_Time:"${ARRAY_OUTPUT[23]}"
      Bytes_In/Sec:"${ARRAY_OUTPUT[24]}" Bytes_Out/Sec:"${ARRAY_OUTPUT[25]}
</pre>
<p><span lang="en-us">This script calls <em>cfstat</em> via ssh on the coldfusion server, and format the data for cacti. With the parameter -n you disable the header output and option -x enables all values. For manual for remote command execution with ssh use google or <a title="http://oreilly.com/pub/h/66" href="http://oreilly.com/pub/h/66" target="_blank">http://oreilly.com/pub/h/66</a>. You don&#8217;t need root permissons for <em>cfstat</em>. You can download the script here:</span></p>
<a class="downloadlink" href="http://www.mogilowski.net/wp-content/plugins/download-monitor/download.php?id=6" title="Version 0.1 heruntergeladen 283 mal" >getColdFusionStats.sh (756 bytes)</a>
<p><span lang="en-us">Save it in the script directory of cacti.</span>(Debian: /usr/share/cacti/site/scripts/getColdFusionStats.sh)</p>
<p><span lang="en-us">Now you have to create the cacti templates. Look at the documentation of cacti for more informations. Here is my template:</span></p>
<a class="downloadlink" href="http://www.mogilowski.net/wp-content/plugins/download-monitor/download.php?id=5" title="Version 0.1 heruntergeladen 280 mal" >cacti_host_template_host_coldfusion_server.xml (3.37 KB)</a>
<p><span lang="en-us">This values will be graphed: AvgQ Time, AvgReq Time, AvgDB Time, Req TO&#8217;ed</span></p>
<p><span lang="en-us">Some screenshots:</span></p>
<div class="ngg-galleryoverview" id="ngg-gallery-9-30">

	<!-- Slideshow link -->
	<div class="slideshowlink">
		<a class="slideshowlink" href="http://www.mogilowski.net/lang/en-us/2008/07/02/monitoring-an-coldfusion-server-with-cacti?show=slide">
			[Show as slideshow]		</a>
	</div>

	
	<!-- Thumbnails -->
		
	<div id="ngg-image-58" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.mogilowski.net/wp-content/gallery/cf_cacti/request_timeout.jpg" title=" " class="shutterset_set_9" >
								<img title="request_timeout.jpg" alt="request_timeout.jpg" src="http://www.mogilowski.net/wp-content/gallery/cf_cacti/thumbs/thumbs_request_timeout.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-59" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.mogilowski.net/wp-content/gallery/cf_cacti/average_request_time.jpg" title=" " class="shutterset_set_9" >
								<img title="average_request_time.jpg" alt="average_request_time.jpg" src="http://www.mogilowski.net/wp-content/gallery/cf_cacti/thumbs/thumbs_average_request_time.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-60" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.mogilowski.net/wp-content/gallery/cf_cacti/average_queue_time.jpg" title=" " class="shutterset_set_9" >
								<img title="average_queue_time.jpg" alt="average_queue_time.jpg" src="http://www.mogilowski.net/wp-content/gallery/cf_cacti/thumbs/thumbs_average_queue_time.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-61" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.mogilowski.net/wp-content/gallery/cf_cacti/average_db_time.jpg" title=" " class="shutterset_set_9" >
								<img title="average_db_time.jpg" alt="average_db_time.jpg" src="http://www.mogilowski.net/wp-content/gallery/cf_cacti/thumbs/thumbs_average_db_time.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	
 	
</div>

<p><span lang="en-us">Please give me feedback for this template.</span></p>
<p><span lang="en-us"><strong>Note:</strong> Only available for singe server instance of coldfusion, because <em>cfstat</em> is not available in the multiserver configuration.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mogilowski.net/lang/en-us/2008/07/02/monitoring-an-coldfusion-server-with-cacti/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Webmin und SSH mit Fail2ban unter Debian absichern</title>
		<link>http://www.mogilowski.net/lang/en-us/2008/05/19/webmin-und-ssh-mit-fail2ban-unter-debian-absichern</link>
		<comments>http://www.mogilowski.net/lang/en-us/2008/05/19/webmin-und-ssh-mit-fail2ban-unter-debian-absichern#comments</comments>
		<pubDate>Mon, 19 May 2008 14:02:13 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bruce-force]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[fail2ban]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[webmin]]></category>

		<guid isPermaLink="false">http://www.mogilowski.net/?p=21</guid>
		<description><![CDATA[Fail2ban kann IP Adressen aufgrund einer bestimmten Anzahl fehlgeschlagener Loginversuche, für eine Einstellbare Zeit blockieren. D.h. es werden per &#8220;IPTables&#8221; alle Pakete von dieser Adresse verworfen. Auf diese Weise kann man sich vor Bruce-Force-Angriffen schützen, da nach einer festgelegten Anzahl von Loginversuchen, kein Zugriff mehr auf den Server möglich ist. Installation: aptitude install fail2ban Die [...]]]></description>
			<content:encoded><![CDATA[<p>Fail2ban kann IP Adressen aufgrund einer bestimmten Anzahl fehlgeschlagener Loginversuche, für eine Einstellbare Zeit blockieren. D.h. es werden per &#8220;IPTables&#8221; alle Pakete von dieser Adresse verworfen. Auf diese Weise kann man sich vor Bruce-Force-Angriffen schützen, da nach einer festgelegten Anzahl von Loginversuchen, kein Zugriff mehr auf den Server möglich ist.</p>
<p>Installation:</p>
<pre>aptitude install fail2ban</pre>
<p>Die fehlgeschlagenen Loginversuche werden von Fail2ban durch Filterregeln ermittelt. Für ssh existiert bereits eine Filterregel, für webmin muss man selbst eine anlegen. Dazu kopiert man zuerst die Filterregel für ssh</p>
<pre>cp /etc/fail2ban/filter.d/sshd.conf /etc/fail2ban/filter.d/webmin.conf
vim /etc/fail2ban/filter.d/webmin.conf</pre>
<p>und tauscht anschließend die Zeile mit der &#8220;failregex&#8221; durch diese aus</p>
<pre>failregex = (?:(?:Invalid login&#124;Non-existent login) as(?: [iI](?:llegal&#124;nvalid) user)
?&#124;[Ii](?:llegal&#124;nvalid) user&#124;ROOT LOGIN REFUSED) .*(?: from&#124;FROM) &#60;HOST&#62;</pre>
<p>Nun kann man die fail2ban Konfiguration anpassen:</p>
<pre>touch /etc/fail2ban/jail.local
vim /etc/fail2ban/jail.local</pre>
<p>und dort folgenden Inhalt einfügen:</p>
<pre>[ssh]
enabled = true
port    = 22
filter  = sshd
logpath  = /var/log/auth.log
maxretry = 3

[webmin]
enabled = true
port    = 10000
filter  = webmin
logpath  = /var/log/auth.log
maxretry = 3</pre>
<p>Anschließend muss Fail2ban neu geladen werden, damit die Konfiguration übenommen wird.</p>
<pre>fail2ban-client reload</pre>
<p>Fail2ban legt für jeden Service eine eigene Chain in den INPUT IPTables an. In diesem Fall also &#8220;<em>Run chain fail2ban-webmin</em>&#8221; und &#8220;<em>Run chain fail2ban-ssh</em>&#8220;. In diesen Chains werdem alle IP Adressen vermerkt, welche die maximale Anzahl von Loginversuchen überschritten haben, und damit ausgesperrt sind. Wenn die &#8220;<em>bantime</em>&#8221; vorüber ist, werden die Einträge wieder entfernt. Man sperrt sich also selbst nicht für immer aus, wenn man mal selbst zuoft ein falsches Passwort eingegeben hat.</p>
<p>Natürlich kann man auf diese Weise noch weitere Dienste wie Apache usw. entsprechend absichern. Fail2ban liefert dafür bereits einige entsprechende Filter mit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mogilowski.net/lang/en-us/2008/05/19/webmin-und-ssh-mit-fail2ban-unter-debian-absichern/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching 29/59 queries in 0.037 seconds using apc
Object Caching 676/703 objects using apc

Served from: www.mogilowski.net @ 2012-05-22 17:58:14 -->
