<?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>Cow Computing &#187; Linux</title>
	<atom:link href="http://www.cowcomputing.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cowcomputing.com</link>
	<description>Share Info about Cloud Computing &#38; Programming</description>
	<lastBuildDate>Thu, 22 Jul 2010 17:10:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Jailkit &#8211; Limit User Account on Linux</title>
		<link>http://www.cowcomputing.com/2010/03/12/jailkit-limit-user-account-on-linux/</link>
		<comments>http://www.cowcomputing.com/2010/03/12/jailkit-limit-user-account-on-linux/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 07:16:07 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[User Account]]></category>

		<guid isPermaLink="false">http://www.cowcomputing.com/?p=201</guid>
		<description><![CDATA[There&#8217;s once I was required to setup a limited shell access user account on a commercial hardware product, in which to secure the original system from being modified and at the same time to provide a flexible environment for general work. I was on the way to make use of chroot command. Then i was [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s once I was required to setup a limited shell access user account on a commercial hardware product, in which to secure the original system from being modified and at the same time to provide a flexible environment for general work. I was on the way to make use of chroot command. Then i was lucky to came across <a href="http://olivier.sessink.nl/jailkit">Jailkit</a>, which saved me a lot of time. So, i would like to use this post to give a little introduction on how to use it.</p>
<pre class="brush:bash"># First, let's create a directory for the jail account
mkdir /jail
chown root:root /jail

# Then we create a new user account specially for jail account
# *replace &lt;group name&gt;, &lt;username&gt;, &lt;password&gt; with your own value
groupadd &lt;group name&gt;
useradd -d /home/jail -g &lt;group name&gt; -p &lt;password&gt; &lt;username&gt;

# For example, if we only want to allow the jail account to have ssh and basic shell access
jk_init -v -j /jail basicshell ssh

# Then we shall jail the user account we previously created to the jail directory
jk_jailuser -m -j /jail &lt;username&gt;
</pre>
<p><span id="more-201"></span><br />
Now the jail account and file system is ready, however if you want more control, we can do the following.</p>
<pre class="brush:bash"># OPTIONAL: Edit /jail/etc/passwd file and /jail/etc/group file to further limit the access
# The following further limit the user logged in jail account to have only access to bash
# Assume the jail user account &amp; group = jail_user, and we edit the passwd file
jail_user:x:1016:1016:/home/jail:/bin/bash

# edit group file
jail_user:x:1016
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.cowcomputing.com/2010/03/12/jailkit-limit-user-account-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Mail Server Setup on Ubuntu (Step By Step Guide)</title>
		<link>http://www.cowcomputing.com/2010/01/22/simple-mail-server-setup-on-ubuntu-step-by-step-guide/</link>
		<comments>http://www.cowcomputing.com/2010/01/22/simple-mail-server-setup-on-ubuntu-step-by-step-guide/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 08:47:29 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[mail server]]></category>
		<category><![CDATA[pop3]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.cowcomputing.com/?p=161</guid>
		<description><![CDATA[Often you will have to setup a mail server especially when you own a web server or VPS, however, this task is dauntingly hard, since mail is an old product. So, here I would like to jot down a step by step guide to walk through the setup of a simple mail server. By the [...]]]></description>
			<content:encoded><![CDATA[<p>Often you will have to setup a mail server especially when you own a web server or VPS, however, this task is dauntingly hard, since mail is an old product. So, here I would like to jot down a step by step guide to walk through the setup of a simple mail server. By the end of this article, a working IMAP/POP3 server will be up. Nonetheless, if any extra stuff (e.g. the use of spam filter or so) is needed, they can be installed on top later.</p>
<p>First, we have to install &#8220;postfix&#8221; as the MTA and &#8220;mailx&#8221; as the mail utility.</p>
<pre class="brush:bash">sudo apt-get install postfix
sudo apt-get install mailx</pre>
<p>Then, we will create a user on ubuntu as the mail user account</p>
<pre class="brush:bash">sudo useradd -m -s /bin/bash &lt;username&gt;
sudo passwd &lt;username&gt;</pre>
<p>Now, the first step is done, and we might have a test on it by issuing</p>
<pre class="brush:bash">netcat localhost 25</pre>
<p>and it should prompt you with this</p>
<pre class="brush:bash">220 localhost ESMTP Postfix (Ubuntu)</pre>
<p><span id="more-161"></span>Next, we shall setup the &#8220;Maildir&#8221; mailboxes for the sake of scalability, this is preferred over the &#8220;mbox&#8221; mailbox</p>
<pre class="brush:bash">sudo postconf -e "home_mailbox = Maildir/"
sudo postconf -e "mailbox_command = "

## restart the postfix
sudo /etc/init.d/postfix restart
</pre>
<p>Now, the setup of postfix is done, and we should move to MDA, and here I have chosen to use &#8220;Dovecot&#8221; since this is the first MDA I tried and i am used to it. (*note: this install both IMAP and POP3, and you might only install either one of them in case)</p>
<pre class="brush:bash">sudo apt-get install dovecot-imapd dovecot-pop3d</pre>
<p>Open up /etc/dovecot/dovecot.conf, and make sure the following setting is made</p>
<pre class="brush:bash">protocols = pop3 pop3s imap imaps
pop3_uidl_format = %08Xu%08Xv

## to allow remote access
listen = *

## only set it to no, if the server is to be used with virtual account or internally, else ignore this setting
disable_plaintext_auth = no

mail_location = maildir:/home/%u/Maildir
</pre>
<p>Then start up the dovecot</p>
<pre class="brush:bash">/etc/init.d/dovecot start</pre>
<p>Up to this moment, the mail server is ready, however if you need SSL support and thunderbird support, read the rest.<br />
To be able to make use of SSL, you need to generate a key and certificate through openSSL, and can be referred to this previous <a href="http://www.cowcomputing.com/2010/01/22/creating-keystore-and-self-signed-certificate-with-openssl">article</a>.<br />
After the key and certificate is ready, set it as follow inside the /etc/dovecot/dovecot.conf</p>
<pre class="brush:bash">ssl_cert_file = /etc/ssl/certs/&lt;certificate file&gt;.crt
ssl_key_file = /etc/ssl/private/&lt;key file&gt;.key
ssl_disable = no</pre>
<p>Finally, to allow thunderbird client to connect to the mail server, modify /etc/dovecot/dovecot.conf as follows:</p>
<pre class="brush:bash">protocol imap {
...
login_greeting_capability = yes
imap_client_workarounds = tb-extra-mailbox-sep
}
</pre>
<p>Reference: <a href="https://help.ubuntu.com/community/PostfixBasicSetupHowto">Postfix How-To</a> <a href="https://help.ubuntu.com/community/Dovecot">Dovecot</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cowcomputing.com/2010/01/22/simple-mail-server-setup-on-ubuntu-step-by-step-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some Useful Linux Commands to Network Info</title>
		<link>http://www.cowcomputing.com/2009/09/28/some-useful-linux-commands-to-network-info/</link>
		<comments>http://www.cowcomputing.com/2009/09/28/some-useful-linux-commands-to-network-info/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 04:29:29 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://steve.katyyeung.com/?p=44</guid>
		<description><![CDATA[Here, i would like to share with you all some commands that is useful in extracting network information from the OS. 1. Extracting IP of the current machine ifconfig &#124; grep 'inet addr:' &#124; grep -v '127.0.0.1' &#124; cut -d: -f2 &#124; awk '{print $1}' 2. Getting the Gateway of the current machine route -n [...]]]></description>
			<content:encoded><![CDATA[<p>Here, i would like to share with you all some commands that is useful in extracting network information from the OS.</p>
<p>1. Extracting IP of the current machine</p>
<pre class="brush:bash">ifconfig | grep 'inet addr:' | grep -v '127.0.0.1' | cut -d: -f2 | awk '{print $1}'</pre>
<p>2. Getting the Gateway of the current machine</p>
<pre class="brush:bash">route -n | grep 'UG[ \t]' | awk '{print $2}'</pre>
<p>3. Updating the network settings</p>
<pre class="brush:bash">// ifconfig &lt;network interface&gt; &lt;ip&gt; netmask &lt;subnetmask&gt; broadcast &lt;broadcast address&gt;
ifconfig eth0 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255</pre>
<p>4. Updating Gateway</p>
<pre class="brush:bash">// in order to achieve this, we need to first delete the
// existing gateway entry and then add the new one
route del default

// route add -net default gw &lt;gateway address&gt; netmask 0.0.0.0 dev eth0;
route add -net default gw 192.168.0.255 netmask 0.0.0.0 dev eth0</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.cowcomputing.com/2009/09/28/some-useful-linux-commands-to-network-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
