<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://hawking.nonlogic.org/styles/feed.css"?>
<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/">
<channel>
<title>hawking's weblog</title>
<link>http://hawking.nonlogic.org/archives/linux/</link>
<description>quark! quark! beware the quantum duck!</description>
<dc:language>en-us</dc:language>
<dc:creator>hawking</dc:creator>
<dc:date>2008-05-05T14:29:39+03:00</dc:date>
<admin:generatorAgent rdf:resource="http://nanoblogger.sourceforge.net" />
<item>
<link>http://hawking.nonlogic.org/archives/2007/04/06/ufs2_write_support_for_linux/</link>
<title>ufs2 write support for linux</title>
<dc:date>2007-04-06T08:33:32+03:00</dc:date>
<dc:creator>hawking</dc:creator>
<dc:subject>english, linux</dc:subject>
<description>
<![CDATA[<p>I've been booting gentoo/freebsd and gentoo for a while and one problem
I've faced is a decent filesystem for the operating systems to share. FreeBSD
has read-write support for ext2 and read-only support for reiserfs. ext3 is
also supported as it's backwards compatible with ext2.</p>

<p>Well ext3 is a cool filesystem to use but I've been experiencing weird
problems with it on FreeBSD. So I went on to check for linux kernel changes
today to see if there is any plan to add UFS2 write support anytime in the
future. I was shocked :). There are already patches written and it's
planned to be added on 2.6.21. I quickly got the git-sources and tried it. It
works like charm so far :). I can mount ufs2 partitions r/w on both
systems. Many thanks to Evgeniy Dushistov who wrote the patches.</p>

<p>The patches are here: <br />
<a href="http://lkml.org/lkml/2007/1/29/192">[RFC] [PATCH 1/3] ufs2 write: mount as rw</a>
<br />
<a href="http://lkml.org/lkml/2007/1/29/193">[RFC] [PATCH 2/3] ufs2 write: inodes write</a>
<br />
<a href="http://lkml.org/lkml/2007/1/29/194">[RFC] [PATCH 3/3] ufs2 write: block allocation update</a>
</p>]]>
</description>
</item>
<item>
<link>http://hawking.nonlogic.org/archives/2007/03/12/sshguard-2/</link>
<title>sshguard-2</title>
<dc:date>2007-03-12T03:45:55+03:00</dc:date>
<dc:creator>hawking</dc:creator>
<dc:subject>english, linux</dc:subject>
<description>
<![CDATA[I've been experimenting with sshguard today. It turns out it won't parse the
log messages when sshd is using pam for authentication. <em>pam_tally</em>
might be used to prevent brute forces but I don't think it's as practical as
sshguard so I decided to add support for PAM messages to sshguard.
<br />
On my system this is how a PAM authentication failure looks like:
<pre>Mar 12 03:24:11 mars sshd[10656]: pam_unix(sshd:auth): authentication failure;
logname= uid=0 euid=0 tty=ssh ruser= rhost=127.0.0.1  user=hawking</pre>
<br />
I added a regex to parse the messages among with the other changes. The
patch and the updated ebuild are <a
href="stuff/gentoo/net-misc/sshguard">here</a>. It works fine now. To check
just start entering wrong passwords to sshd:
<pre>hawking@mars ~ $ ssh mars.solar
Password: ..wrong password..
Password: and again
Password: and again..
Permission denied (publickey,keyboard-interactive).
hawking@mars ~ $ ssh mars.solar
Password: ..wrong password..</pre>
<br />
After four tries sshguard blocked me :-)
<pre>Mar 12 03:24:11 mars sshguard[10658]: Blocking 127.0.0.1: 4 failures
over 12 seconds</pre>
<br />
I think sshguard will be cool when it has a list of different regexes to
parse with. I'm planning to let upstream know about it.]]>
</description>
</item>
<item>
<link>http://hawking.nonlogic.org/archives/2007/03/11/sshguard/</link>
<title>sshguard</title>
<dc:date>2007-03-11T03:01:46+03:00</dc:date>
<dc:creator>hawking</dc:creator>
<dc:subject>english, linux</dc:subject>
<description>
<![CDATA[There are many tools to prevent SSH brute force attacks. My favourite is
sshguard. First of all it's not a script, it's written in C and it's pretty
easy to configure.
<br />
For those who are interested I wrote an <a
href="http://gentoo-sunrise.org/svn/reviewed/net-misc/sshguard/">ebuild</a> for
it, it's in sunrise overlay right now.
<br />
As a short tutorial here is how I configured it. First you need to make
syslog-ng call sshguard in case of an authentication failure. Adding these
lines to <em>syslog-ng.conf</em> would do it:
<pre>destination sshguardproc { program("/usr/sbin/sshguard"); };
filter sshd { facility(authpriv) and match(ssh); };
log { source(src); filter(sshd); destination(sshguardproc); };</pre>
<br />
For efficiency make sure sshd doesn't use DNS when logging IP addresses.
This can be done by adding <pre>UseDNS no</pre> to
<em>/etc/ssh/sshd_config</em>.
<br />
Last but not least we need the iptables configuration to make sshguard work.
First create a new chain called sshguard. Then pass all SSH traffic to this
chain:
<pre>iptables -N sshguard
iptables -A INPUT -p tcp --dport 22 -j sshguard</pre>
<br />
All done :-)]]>
</description>
</item>
<item>
<link>http://hawking.nonlogic.org/archives/2006/12/15/versioning_etc_with_subversion/</link>
<title>versioning /etc with subversion</title>
<dc:date>2006-12-15T09:51:44+03:00</dc:date>
<dc:creator>hawking</dc:creator>
<dc:subject>english, linux</dc:subject>
<description>
<![CDATA[<p>Although portage takes care of configuration files very well, no system can
have enough protection from human errors. Versioning configuration files under
/etc is a nice solution to this. If you do a mistake and delete some file or
any other silliness that might happen , you just revert to a former revision
and solve the problem.</p>
<p>This can be achieved very easily:</p>
<ol>
        <li>First create a svn repository
        <pre>svnadmin create /root/svn</pre>
        </li>
        
        <li>Then import /etc to the repository
        <pre>svn import /etc file:///root/svn -m 'Initial import'</pre>
        </li>

        <li>Checkout the project
        <pre>rm -rf /etc
svn ci file:///root/svn/etc
        </pre>
        </li>
</ol>
<p>Now change some configuration files and do 'svn status' When you change
your configuration files you can commit them to the repository:</p>
<pre>cd /etc
svn ci -m 'Changed MAKEOPTS=j2 in /etc/make.conf'</pre>
Linux rulez!]]>
</description>
</item>
</channel>
</rss>
