<?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>the empty quarter &#187; administration</title>
	<atom:link href="http://www.martinhammer.com/blog/index.php/tag/administration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.martinhammer.com/blog</link>
	<description>Sorry, but you are looking for something that isn’t here.</description>
	<lastBuildDate>Sat, 04 Feb 2012 12:33:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>How to change SSH port number on Ubuntu server</title>
		<link>http://www.martinhammer.com/blog/index.php/2010/09/how-to-change-ssh-port-number-on-ubuntu-server/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2010/09/how-to-change-ssh-port-number-on-ubuntu-server/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 08:56:48 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=562</guid>
		<description><![CDATA[Changing the port number of SSH daemon is a quick way of reducing the number of SSH brute force attacks your server might face (check the file /var/log/auth.log to see if there are many failed SSH login attempts). Just to be on the safe side, create a backup copy of the SSH daemon config file. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Changing the port number of SSH daemon is a quick way of reducing the number of SSH brute force attacks your server might face (check the file <code>/var/log/auth.log</code> to see if there are many failed SSH login attempts).</p>
<ol style="text-align: left;">
<li>Just to be on the safe side, create a backup copy of the SSH daemon config file.<br />
<code><br />
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.vanilla</p>
<p></code></li>
<li>Edit the config file.<br />
<code><br />
sudo vi /etc/ssh/sshd_config</p>
<p></code></li>
<li>Change the port number on the following line, e.g. to 2201 or some other unused port. Make sure you note down the port number.<br />
<code><br />
Port 22</p>
<p></code></li>
<li>Restart the SSH daemon. You might get kicked out of your existing session.<br />
<code><br />
sudo /etc/init.d/ssh restart</p>
<p></code></li>
<li>When you login next remember to include the correct port.<br />
<code><br />
ssh youruser@yourserver -p 2201</p>
<p></code></li>
</ol>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2010/09/how-to-change-ssh-port-number-on-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BADSIG error in Ubuntu Update Manager</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/05/badsig-error-in-ubuntu-update-manager/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/05/badsig-error-in-ubuntu-update-manager/#comments</comments>
		<pubDate>Thu, 14 May 2009 15:56:29 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=199</guid>
		<description><![CDATA[Here are a few things you can try if you get the BADSIG error in Update Manager: Run the following commands from terminal shell: sudo apt-get clean sudo apt-get update -o Acquire::http::No-Cache=True Change the Ubuntu server from which updates are downloaded: System &#62; Software Sources &#62; Ubuntu Software tab &#62; change the selected server in [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Here are a few things you can try if you get the BADSIG error in Update Manager:</p>
<ul>
<li>Run the following commands from terminal shell:<br />
<code><br />
sudo apt-get clean<br />
sudo apt-get update -o Acquire::http::No-Cache=True</p>
<p></code></li>
<li>Change the Ubuntu server from which updates are downloaded: System &gt; Software Sources &gt; Ubuntu Software tab &gt; change the selected server in the &#8220;Download from&#8221; dropdown.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/05/badsig-error-in-ubuntu-update-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Login as someone else</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/04/login-as-someone-else/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/04/login-as-someone-else/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 16:03:38 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=167</guid>
		<description><![CDATA[Sometimes you may want to log in with a different user account in Terminal without logging out from your X session or switching to an unused virtual console. There are two different approaches to do this in Ubuntu: interestingly, it is possible without even knowing the other user&#8217;s password. Approach 1: if you know the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Sometimes you may want to log in with a different user account in Terminal without logging out from your X session or switching to an unused virtual console. There are two different approaches to do this in Ubuntu: interestingly, it is possible without even knowing the other user&#8217;s password.</p>
<p style="text-align: left;">Approach 1: if you know the password of the other account (<code>&lt;username&gt;</code> is replaced with the account you want to log in as, e.g. <code>bob</code> or <code>pinky</code> or whatever):</p>
<p><code>su -l &lt;username&gt;</code></p>
<p style="text-align: left;">Approach 2: if you don&#8217;t know their password. This only works if you have administrative privileges, i.e. your account is in the sudoers file. The password you are prompted for is your own one:</p>
<p><code>sudo -i -u &lt;username&gt;</code></p>
<p style="text-align: left;">or even execute the command from our approach 1 with sudo:</p>
<p><code>sudo sh -c 'su -l &lt;username&gt;'</code></p>
<p style="text-align: left;">Note: It goes without saying that you should behave responsibly and not abuse this to gain access to other user&#8217;s data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/04/login-as-someone-else/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change Oracle XE web ports</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/04/change-oracle-xe-web-ports/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/04/change-oracle-xe-web-ports/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 13:48:56 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=105</guid>
		<description><![CDATA[Oracle Database XE (Express Edition, sometimes also referred to as Apex) comes with an embedded web interface for administration. By default the HTTP port of this web interface is 8080. This can be checked by running the query below when logged in as system: SQL&#62; select dbms_xdb.gethttpport from dual; In order to change the port [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><a href="http://www.oracle.com/technology/products/database/xe/index.html">Oracle Database XE</a> (Express Edition, sometimes also referred to as Apex) comes with an embedded web interface for administration. By default the HTTP port of this web interface is 8080. This can be checked by running the query below when logged in as system:</p>
<p><code>SQL&gt; select dbms_xdb.gethttpport from dual;</code></p>
<p style="text-align: left;">In order to change the port number, run the following SQL (the port is changed to 8181 in the example below) and restart the database:</p>
<p><code>SQL&gt; begin<br />
dbms_xdb.sethttpport('8181');<br />
end;<br />
/<br />
</code></p>
<p style="text-align: left;">If you want to disable the HTTP access altogether, you can set the port number to 0.</p>
<p style="text-align: left;">There are also similar methods <code>dbms_xdb.getftpport</code> and <code>dbms_xdb.setftpport</code>, although I am not sure in what context FTP is used with Oracle XE. By default the port is 0, i.e. disabled.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/04/change-oracle-xe-web-ports/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>This incident will be reported</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/04/this-incident-will-be-reported/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/04/this-incident-will-be-reported/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 01:23:12 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[commandline]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=89</guid>
		<description><![CDATA[My recent misadventures with adding a group membership for my user and in the process managing to remove all other groups (including admin) got me thinking about the message &#8220;... is not in the sudoers file. This incident will be reported.&#8221; Exactly where and how and to whom is this reported? Well, according to clever [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">My <a href="./?p=37">recent misadventures</a> with adding a group membership for my user and in the process managing to remove all other groups (including admin) got me thinking about the message &#8220;<code>... is not in the sudoers file. This incident will be reported.</code>&#8221; Exactly where and how and to whom is this reported?</p>
<p style="text-align: left;">Well, according to <a href="http://www.linuxquestions.org/questions/ubuntu-63/this-incident-will-be-reported-683421/">clever people on linuxquestions.org</a>, the log file where unsuccessful sudo attempts are logged (as well as other things related to authentication) is <code>/var/log/auth.log</code>. The command below will show you just those entries for unsucessful sudo attempts:</p>
<p style="text-align: left;"><code>grep "user NOT in sudoers" /var/log/auth.log</code></p>
<p style="text-align: left;">Note also that a new file is created once the log reaches a certain size, and older files are archived. So if you need to check properly you will also want to look into the archived files (listing from my old Xubuntu laptop shown below):</p>
<p style="text-align: left;"><code>ls -l /var/log/auth.log*<br />
-rw-r----- 1 syslog adm  2319 2009-04-20 21:38 /var/log/auth.log<br />
-rw-r----- 1 syslog adm 68936 2009-04-20 06:33 /var/log/auth.log.0<br />
-rw-r----- 1 syslog adm  3697 2009-04-13 06:17 /var/log/auth.log.1.gz<br />
-rw-r----- 1 syslog adm  1182 2009-04-04 10:17 /var/log/auth.log.2.gz<br />
-rw-r----- 1 syslog adm  2088 2009-03-26 19:04 /var/log/auth.log.3.gz<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/04/this-incident-will-be-reported/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securing SSH</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/04/securing-ssh/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/04/securing-ssh/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 02:35:02 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=51</guid>
		<description><![CDATA[This article on The Register has a link to a very good page on CentOS website with tips on securing OpenSSH. The tips are applicable for all distros, not just CentOS, and are definitely worth going through and implementing if you have SSH enabled on your server. Good luck and stay secure.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.theregister.co.uk/2009/04/17/ssh_attacks/">This article</a> on The Register has a link to a very good page on CentOS website with <a href="http://wiki.centos.org/HowTos/Network/SecuringSSH">tips on securing OpenSSH</a>. The tips are applicable for all distros, not just CentOS, and are definitely worth going through and implementing if you have SSH enabled on your server.</p>
<p>Good luck and stay secure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/04/securing-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add user to group with usermod</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/04/add-user-to-group-using-usermod-command/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/04/add-user-to-group-using-usermod-command/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 10:12:30 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[commandline]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=37</guid>
		<description><![CDATA[Here is a very simple one which caught me out: you want to add your user to a group through command line. The command is very straightforward: sudo usermod -aG tools hammer This adds the user &#8220;hammer&#8221; to the group &#8220;tools&#8221;. Notice the -a switch (for add). This means &#8220;hammer&#8221; will become member of &#8220;tools&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Here is a very simple one which caught me out: you want to add your user to a group through command line. The command is very straightforward:</p>
<p style="text-align: left;"><code>sudo usermod -aG tools hammer</code></p>
<p style="text-align: left;">This adds the user &#8220;hammer&#8221; to the group &#8220;tools&#8221;. Notice the -a switch (for add). This means &#8220;hammer&#8221; will become member of &#8220;tools&#8221; and keep his exiting group memberships. However, if you run the command without the -a switch:</p>
<p style="text-align: left;"><code>sudo usermod -G tools hammer</code></p>
<p style="text-align: left;">Then &#8220;hammer&#8221; becomes member of &#8220;tools&#8221; (all well and good) but has lost its other group associations defined previously &#8211; including on Ubuntu the group &#8220;admin&#8221;. So that next time you log in (you need to log out and back in for the group memberships to be reflected properly) and try to run sudo something you get a nice message like so:</p>
<p style="text-align: left;"><code>hammer is not in the sudoers file. This incident will be reported.</code></p>
<p style="text-align: left;">Luckily, I had another user with admin priviledges on the machine and so was able to add all the groups which I removed by mistake. In any case, I will now remember to include the -a option next time I run usermod to add user to a group!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/04/add-user-to-group-using-usermod-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

