<?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>marius &#187; SSH</title>
	<atom:link href="http://devilx.net/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://devilx.net</link>
	<description></description>
	<lastBuildDate>Wed, 25 Jan 2012 07:42:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>OTRS LDAP Authentication for Agents and Customers</title>
		<link>http://devilx.net/2010/03/19/otrs-ldap-authentication-for-agents-and-customers/</link>
		<comments>http://devilx.net/2010/03/19/otrs-ldap-authentication-for-agents-and-customers/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 04:05:40 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Linux and stuff ...]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CGI]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[ITIL]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OTRS]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[RADIUS]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.devilx.net/?p=1147</guid>
		<description><![CDATA[Probably many of you have or still are actively using the open-source, ITIL compliant trouble ticket system named OTRS. And probably some of you also might have experienced the pleasure of setting up the software once &#8211; and know the &#8230; <a href="http://devilx.net/2010/03/19/otrs-ldap-authentication-for-agents-and-customers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Probably many of you have or still are actively using the open-source, ITIL compliant trouble ticket system named <a href="http://otrs.org/">OTRS</a>. And probably some of you also might have experienced the pleasure of setting up the software once &#8211; and know the pain.</p>
<p>OTRS as a product is pretty cool and full of features, unfortunately from a technical aspect it&#8217;s pretty much of an unaesthetic &#8220;Perl hack&#8221; that&#8217;s, especially when you should try to integrate it into your existing environments and make it talk to your RADIUS or directly to your LDAP. Here, I would like to describe the basic configuration to get the latter working without any troubles.</p>
<p>Everything actually starts within the $OTRSHOME/Kernel/Config.pm. After you&#8217;ve set up your Apache to get you displayed the <em>/otrs/index.pl</em> and <em>/otrs/customer.pl</em> you&#8217;ll need to start hacking Perl in OTRS&#8217; &#8220;config file&#8221;.<br />
Let&#8217;s say, that we would want to authenticate against LDAP. And maybe not only for the agents (the people using index.pl) but also for the customers. So, let&#8217;s assume that we&#8217;re having a LDAP-tree containing our Base (&#8220;dc=something,dc=com&#8221;) and our &#8220;Users&#8221; OU (&#8220;ou=Users,dc=something,dc=com&#8221;). Also, we have a &#8220;Groups&#8221; OU (&#8220;ou=Groups,dc=something,dc=com&#8221;). I think that&#8217;s probably the most common built-up, regardless what names the OUs actually have.</p>
<p>Now, first of all, we need to know what user we could use to authenticate on our LDAP later and get the information we need. Here, I&#8217;m assuming it&#8217;s &#8220;cn=admin,dc=something,dc=com&#8221;. Let&#8217;s begin with the configuration for getting the agents authenticated:</p>
<pre>
    $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
    $Self->{'AuthModule::LDAP::Host'} = 'localhost';
    $Self->{'AuthModule::LDAP::BaseDN'} = 'dc=something,dc=com';
    $Self->{'AuthModule::LDAP::UID'} = 'uid';
    $Self->{'AuthModule::LDAP::GroupDN'} = 'cn=otrsagent,ou=Groups,dc=something,dc=com';
    $Self->{'AuthModule::LDAP::UserAttr'} = 'UID';
    $Self->{'AuthModule::LDAP::AccessAttr'} = 'memberUid';
    $Self->{'AuthModule::LDAP::Params'} = {
        port => 389,
        timeout => 120,
        async => 0,
        version => 3,
    };
</pre>
<p>The configuration should be pretty self-describing, though let&#8217;s sum it up: We&#8217;re connecting to the LDAP host &#8220;localhost&#8221; (since we probably tunnel the SSH port to the OTRS machine or have it running directly on that one &#8211; else you&#8217;d just need to specify another hostname/IP. BEWARE: When using an external LDAP with no tunnel you <strong>should</strong> use LDAPS!) and use our BaseDN. We define the user-id field being named &#8220;uid&#8221;, just like the user-attribute we&#8217;re going to look-up and we&#8217;ll be using the memberUid as access-attribute. Wait. memberUid? I lost you, right?</p>
<p>In this configuration, we&#8217;re also using a GroupDN that actually lets us &#8220;filter&#8221; which of our users might be allowed to use the OTRS as agents. For this, we&#8217;re accessing the group &#8220;otrsagent&#8221; within our &#8220;Groups&#8221;-OU and lookig up the memberUids.<br />
At last but not least, the actual LDAP parameters like the port for example.</p>
<p>Now, you can test your login by browsing to your index.pl and enter the credentials of an LDAP-user being in your otrsagent-group. You should now be possible to authenticate. Nothing more. You won&#8217;t be able to login to your OTRS yet. Why? It&#8217;s simple: OTRS uses LDAP only for authentication but initially copies the user-data from LDAP into its own database backend. Therefor we need to set up the &#8220;AuthSyncModule&#8221;.</p>
<p>This module allows us to tell OTRS that we&#8217;d like to have our user data being synchronized with the LDAP database. Let&#8217;s take a look at the actual configuration:</p>
<pre>
    $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host'} = 'ldap://localhost/';
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=something, dc=com';
    $Self->{'AuthSyncModule::LDAP::UID'} = 'uid';
    $Self->{'AuthSyncModule::LDAP::UserAttr'} = 'UID';
    $Self->{'AuthSyncModule::LDAP::AccessAttr'} = 'memberUid';
    $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'cn=admin,dc=something,dc=com';
    $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'swordfish';

    $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
        UserFirstname => 'givenName',
        UserLastname  => 'sn',
        UserEmail     => 'mail',
    };
    $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [
        'users',
    ];
</pre>
<p>Again, from top to bottom: We tell OTRS what LDAP host, what BaseDN, what UID/UserAttr/AccessAttr, what search user and what password to use. Then, we need to define what&#8217;s needed to be synchronized. Here, we only sync the most important data: First name, last name and e-mail. Note: Without the mail entry this won&#8217;t work!<br />
After that, we define what OTRS-groups the user should initially be in.</p>
<p>Now you should be able to authenticate <strong>and</strong> login with your LDAP user. <img src='http://devilx.net/wp-content/plugins/smilies-themer/Riceballs/smile.png' alt=':)' class='wp-smiley' /> </p>
<p><strong>Next, customer authentication.</strong></p>
<p>The customer authentication needs to be configured separately and also starts with basic LDAP information:</p>
<pre>
    $Self->{'Customer::AuthModule'} = 'Kernel::System::CustomerAuth::LDAP';
    $Self->{'Customer::AuthModule::LDAP::Host'} = 'localhost';
    $Self->{'Customer::AuthModule::LDAP::BaseDN'} = 'dc=something,dc=com';
    $Self->{'Customer::AuthModule::LDAP::UID'} = 'uid';
    $Self->{'Customer::AuthModule::LDAP::GroupDN'} = 'cn=otrscustomer,ou=Groups,dc=something,dc=com';
    $Self->{'Customer::AuthModule::LDAP::UserAttr'} = 'UID';
    $Self->{'Customer::AuthModule::LDAP::AccessAttr'} = 'memberUid';
    $Self->{'Customer::AuthModule::LDAP::SearchUserDN'} = 'cn=admin,dc=something,dc=com';
    $Self->{'Customer::AuthModule::LDAP::SearchUserPw'} = 'swordfish';
    $Self->{'Customer::AuthModule::LDAP::Params'} = {
        port => 389,
        timeout => 120,
        async => 0,
        version => 3,
    };
</pre>
<p>I think I don&#8217;t need to comment this section once again. Next:</p>
<pre>
    $Self->{CustomerUser} = {
      Name => 'LDAP Datasource',
      Module => 'Kernel::System::CustomerUser::LDAP',
      Params => {
         Host => 'localhost',
         BaseDN => 'dc=something,dc=com',
         SSCOPE => 'sub',
         UserDN => 'cn=admin,dc=something,dc=com',
         UserPW => 'swordfish',
         Params => {
            port => 389,
            timeout => 120,
            async => 0,
            version => 3,
         },
      },
      CustomerKey => 'uid',
      CustomerID => 'mail',
      CustomerUserListFields => ['sn', 'cn', 'mail'],
      CustomerUserSearchFields => ['uid', 'cn', 'sn', 'mail'],
CustomerUserSearchPrefix => '',
       CustomerUserSearchSuffix => '*',
       CustomerUserSearchListLimit => 250,
       CustomerUserPostMasterSearchFields => ['mail'],
       CustomerUserNameFields => ['givenname', 'sn'],
       CustomerUserExcludePrimaryCustomerID => 0,
       AdminSetPreferences => 0,
       Map => [
           [ 'UserSalutation', 'Title',      'title',           1, 0, 'var', '', 0 ],
           [ 'UserFirstname',  'Firstname',  'cn',              1, 1, 'var', '', 0 ],
           [ 'UserLastname',   'Lastname',   'sn',              1, 1, 'var', '', 0 ],
           [ 'UserLogin',      'Username',   'uid',             1, 1, 'var', '', 0 ],
           [ 'UserEmail',      'Email',      'mail',            1, 1, 'var', '', 0 ],
           [ 'UserCustomerID', 'CustomerID', 'mail',            0, 1, 'var', '', 0 ],
           [ 'UserPhone',      'Phone',      'telephonenumber', 1, 0, 'var', '', 0 ],
           [ 'UserAddress',    'Address',    'postaladdress',   1, 0, 'var', '', 0 ],
           [ 'UserComment',    'Comment',    'description',     1, 0, 'var', '', 0 ],
       ],
    };
</pre>
<p>This is theoretically the same we&#8217;ve also set up for the agents and will let OTRS synchronize the customer data into its own database. I think the whole mapping should be pretty clear when read carefully, so I&#8217;m not going to explain every setting in detail.</p>
<p>However, after you&#8217;ve hacked together your basic configuration in this kinda way, also the customer.pl authentication should be working against your LDAP.</p>
<p>There&#8217;s one more thing that&#8217;s left to be mentioned. When you authenticate your agents against the LDAP, OTRS will try to authenticate root@localhost against it &#8211; what probably won&#8217;t work anymore then. Of course, you won&#8217;t need to go without an administrative user now. Simply pick one of your LDAP users, add him to the otrsagent group, log in to the web-interface and then adding an entry into the group_user table of OTRS&#8217; database, containing the user_id of your LDAP user (get it from the &#8220;users&#8221; table) and the group_id &#8220;1&#8243;, with the permission_key &#8220;rw&#8221; and the permission_value &#8220;1&#8243;. After that, the user should have administrative rights.</p>
<p>And the next time, I&#8217;ll show you how to build an automatic back-scratcher using a wall, some glue and a cat. Enjoy! <img src='http://devilx.net/wp-content/plugins/smilies-themer/Riceballs/smile.png' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://devilx.net/2010/03/19/otrs-ldap-authentication-for-agents-and-customers/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>TextMate Palm Pre Development Bundle 0.2</title>
		<link>http://devilx.net/2009/11/11/textmate-palm-pre-development-bundle-0-2/</link>
		<comments>http://devilx.net/2009/11/11/textmate-palm-pre-development-bundle-0-2/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 20:55:58 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Life itself]]></category>
		<category><![CDATA[Linux and stuff ...]]></category>
		<category><![CDATA[Mac and stuff ...]]></category>
		<category><![CDATA[New & Cool]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[Bundle]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Cool]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Emulator]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[New]]></category>
		<category><![CDATA[Palm]]></category>
		<category><![CDATA[Pre]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Release]]></category>
		<category><![CDATA[SMS]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[TextMate]]></category>

		<guid isPermaLink="false">http://www.devilx.net/?p=1070</guid>
		<description><![CDATA[Yes, after not even four hours I&#8217;ve already finished building the 0.2-release of my Palm Pre Development Bundle for TextMate. In case you&#8217;re wondering what weird stuff I&#8217;m talking about, please read my previous post first. However, this second release &#8230; <a href="http://devilx.net/2009/11/11/textmate-palm-pre-development-bundle-0-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_1072" class="wp-caption alignleft" style="width: 160px"><a href="http://www.devilx.net/wp-content/uploads/2009/11/palmprebundle-0.2.png"><img class="size-thumbnail wp-image-1072" title="Palm Pre Development Bundle 0.2" src="http://www.devilx.net/wp-content/uploads/2009/11/palmprebundle-0.2-150x150.png" alt="Palm Pre Development Bundle 0.2" width="150" height="150" /></a><p class="wp-caption-text">Palm Pre Development Bundle 0.2</p></div>
<p>Yes, after not even four hours I&#8217;ve already finished building the 0.2-release of my Palm Pre Development Bundle for TextMate. In case you&#8217;re wondering what weird stuff I&#8217;m talking about, <a title="Palm Pre Development Bundle for TextMate" href="http://www.devilx.net/2009/11/11/palm-pre-development-bundle-for-textmate/" target="_self">please read my previous post first</a>.</p>
<p>However, this second release includes a lot more features than it had before, plus I&#8217;ve made use of the CocoaDialog now. Let me describe the new features from the top to the bottom of the screenshot on the left site.</p>
<p>First of all, there&#8217;s &#8220;Generate New Project&#8221;. This lets you execute a palm-generate with all important attributes and opens the created project afterwards using the &#8220;mate&#8221; terminal-command, which needs to be available for this to work. All you have to do then is simply to save the TextMate project right into your generated project-directory.</p>
<p>Next, we still have &#8220;Generate New Scene&#8221;. I&#8217;ve enhanced the feature now, so that you&#8217;ll get a cocoa dialog asking for the scene&#8217;s name. Beware: The generation usually works as it should, the only problem is the TextMate project-drawer, which doesn&#8217;t seem to refresh by itself. A workaround: Cmd+H to hide TextMate and then click on its Dock-icon to make it appear again. Then all newly generated files should be visible in its drawer.</p>
<p>The next three features work just as before, no enhancements at all. On the fourth, the &#8220;Launch Project in Debugging-Mode&#8221; feature, I&#8217;ve implemented a palm-launch with debugging options, that can be run on an existing, packaged and installed project.</p>
<p>Next, there are ways to close and remove installed Projects. &#8220;Close running project&#8221; of course only works, when the App is actually running and &#8220;Remove installed Project&#8221; removes the App from the device. As device for all those commands the first device found by the Palm toolset will be taken &#8211; so if you would like to use the Emulator, better disconnect your real device and vice versa.</p>
<p>I&#8217;ve also built-in two features that let you simulate test calls and SMS on your Emulator, if you changed from password authentication to SSH public key authentication. You can do this either manually or try to use the feature at the menu&#8217;s bottom named &#8220;Auto-install SSH-Pubkey on Emulator&#8221;. Depending on your SSH-key-setup it works out or&#8230; not.</p>
<p>The other seven features allow you to simulate GPS drives on the Emulator &#8211; again only if you&#8217;ve set-up SSH-Pubkey authentication.</p>
<p>I hope you enjoy this release of the Palm Pre Development Bundle for TextMate! <img src='http://devilx.net/wp-content/plugins/smilies-themer/Riceballs/smile.png' alt=':-)' class='wp-smiley' /> </p>
<p><strong><span style="text-decoration: line-through;">Download: </span><a href="http://www.devilx.net/wp-content/uploads/2009/11/Palm-Pre-Bundle-0.2.zip"><span style="text-decoration: line-through;">Palm-Pre-Bundle-0.2</span></a></strong></p>
<p><strong>UPDATE:</strong> There&#8217;s a newer version available! <a title="Palm webOS (formerly Palm Pre) Development Bundle for TextMate 0.3" href="http://www.devilx.net/2009/11/13/palm-webos-formerly-palm-pre-development-bundle-for-textmate-0-3/">Get it here</a>. Or use <a title="GitHub" href="http://github.com/devilx/palm-webos-development-tmbundle">GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://devilx.net/2009/11/11/textmate-palm-pre-development-bundle-0-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon EC2: How to Setup an Instance and Bundle it</title>
		<link>http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/</link>
		<comments>http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:25:46 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Linux and stuff ...]]></category>
		<category><![CDATA[New & Cool]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[AMI]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Bucket]]></category>
		<category><![CDATA[Bundle]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[EBS]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Elastic]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[Instance]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.devilx.net/?p=1033</guid>
		<description><![CDATA[I know, that there are several documentations concerning Amazon&#8217;s Elastic Cloud Computing, though I&#8217;d like to describe some very first steps for using their infrastructure to build (Linux-) instances that fulfill your needs. Let&#8217;s not beat around the bush and &#8230; <a href="http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I know, that there are several documentations concerning Amazon&#8217;s Elastic Cloud Computing, though I&#8217;d like to describe some very first steps for using their infrastructure to build (Linux-) instances that fulfill your needs. Let&#8217;s not beat around the bush and start-over by setting up the very first instance.</p>
<p>The first thing needed is a client computer running any kind of the supported OSs by the Amazon API tools and of course the tools themselves. After you&#8217;ve installed those and configured all credentials the right way, we can create a new pair of SSH keys for our new project. Due to the location I&#8217;m currently in, I&#8217;ve chosen to use Amazon Instances in the western EU. Execute the following line on your command-line:</p>
<blockquote><p>ec2-add-keypair &#8211;region eu-west-1 test-keypair</p></blockquote>
<p>The result should look something like this:</p>
<blockquote><p>[Deprecated] Xalan: org.apache.xml.res.XMLErrorResources_en_US<br />
KEYPAIR	test-keypair	e1:1a:d1:a1:a1:1c:10:a1:b1:d1:cb:11:11:1a:11:11:f1:11:ae:fe<br />
&#8212;&#8211;BEGIN RSA PRIVATE KEY&#8212;&#8211;<br />
XXX<br />
&#8212;&#8211;END RSA PRIVATE KEY&#8212;&#8211;</p></blockquote>
<p>You can now copy the lines from <i>BEGIN&#8230;</i> until <i>END&#8230;</i> (including those two) into a file which you&#8217;ll be using as SSH-key for connecting to your instance. Don&#8217;t forget to <i>chmod 600</i> it!</p>
<p>Next, let&#8217;s see what base-images for creating our instance we could you &#8211; first, provided by Amazon themselves:</p>
<blockquote><p>
ec2-describe-images &#8211;region eu-west-1 -o &#8216;amazon&#8217;
</p></blockquote>
<p>The list is contained of several different OSs and versions, although in our current project we can&#8217;t make use of any of those. Therefor, we&#8217;re now searching for a perfectly fitting, really good operating system:</p>
<blockquote><p>
ec2-describe-images &#8211;region eu-west-1 -a | grep -i debian
</p></blockquote>
<p>And yet, we receive another list with several different versions of the Debian Linux distribution. After we&#8217;ve picked the one we&#8217;d like to run, we should check what instances are currently up and running:</p>
<blockquote><p>
ec2-describe-instances &#8211;region eu-west-1
</p></blockquote>
<p>If you&#8217;re using Amazon&#8217;s EC2 for the first time, there shouldn&#8217;t be any items listed. We can now start our very first instance, by copying the instance&#8217;s identifier (in the second column, a string starting with ami-<id>) and pasting it into our command:</p>
<blockquote><p>
ec2-run-instances &#8211;region eu-west-1 -k test-keypair -g &#8216;http/s&#8217; -g &#8216;ssh&#8217; ami-b8446fcc
</p></blockquote>
<p>In this command, we tell Amazon to start up a new instance that&#8217;s built on top of the ami-b8446fcc-image, using the key-pair we just created before and using some custom built firewall-rules named &#8220;http/s&#8221; (which allows us to connect to port 80 and 443) and &#8220;ssh&#8221; (port 22).</p>
<p>We need to wait a few seconds, until the instance comes up. We can use the describe-instances command from above to check the instance&#8217;s status:</p>
<blockquote><p>
ec2-describe-instances &#8211;region eu-west-1
</p></blockquote>
<p>As soon as it&#8217;s up and running, the &#8220;pending&#8221; column should have been replaced by a dynamically allocated hostname and the status &#8220;running&#8221;. Keep in mind, that this hostname/ip is dynamically allocated! If you want a fixed IP, you need to allocate and assign an Elastic IP &#8211; I&#8217;ll show you later how to do so.<br />
If our firewall rules worked out, we can now connect using SSH:</p>
<blockquote><p>
ssh -i ~/Library/EC2/id_rsa-test-keypair root@ec2-11-111-11-111.eu-west-1.compute.amazonaws.com
</p></blockquote>
<p>By default, Amazon sets up a Small Instance, that provides around 10 GB of hard drive, an Dual-Core AMD Opteron 2218 with 2600 MHz and around 1.7 GB of RAM. Small instances, in comparison to the bigger ones, also still provide a real swap-partition which is limited to 895 MB. Here, you could run into problems when installing some Oracle for example, since the DB would like to have 1 GB or more Swap-space. If 895 MB should not be enough, the only way to enlarge it seems to be to use a file within your file-system for that. Either, by placing it somewhere into / or by using /mnt for that. /mnt is a special mount in Amazon instances which provides you 147 GB of additional <i>volatile</i> storage. Amazon doesn&#8217;t guarantee in any way the storage to be stable/solid or even backed up &#8211; and usually /mnt is only used for bundling your instance. You might now think <i>&#8220;so, where could I place my data, if / is only providing me 10 GB of space and /mnt should not be used for storing sensitive data?&#8221;</i> &#8211; well, there&#8217;s a third possibility named Elastic Block Storage. An EBS is being displayed to your instance as regular block-device (/dev/sdb, &#8230;) that&#8217;s format- and mountable. There, sensitive data could be stored, by bind-mounting the directories you&#8217;d like to have your data in. I&#8217;m not going to explain how this works, else I&#8217;ll never finish writing this brief documentation.</p>
<p>However, since we&#8217;re connected to the instance now, we can set it up the way we want it, with whatever software we need on it. I&#8217;ve assumed, that most people would set it up as regular LAMP-instance, therefor I&#8217;ve also added the firewall-rule for HTTP/HTTPS. After we finished installing the software we need, there&#8217;s one more package that should be plugged into the system: The Amazon AMI Tools. Simply wget them from http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip and unzip the package. Those tools make use of Ruby, so ensure having it installed on your instance. Also, you need to have the private key (pk-<id>.pem) and the certificate (cert-<id>.pem) you created the instance with somewhere within your instance&#8217;s filesystem, for later use.</p>
<p>Before we bundle up our system now, let&#8217;s come back to the topic we had before: The hostname/IP. Amazon allocates some dynamic address, unless you tell them to give you a fixed (called Elastic) IP. You can do that by simply executing:</p>
<blockquote><p>
ec2-allocate-address &#8211;region eu-west-1
</p></blockquote>
<p>&#8230; within your client&#8217;s command-line (where the Amazon API Tools have been installed &#8211; not on the instance!). As result you&#8217;ll get some IP address that has now being allocated by Amazon for you. The IP isn&#8217;t bound to any instance yet &#8211; it&#8217;s just allocated for you to be able to use it. ATTENTION: You pay for Elastic IPs as long as you do not assign them to an instance. Yes, that&#8217;s right. Amazon charges you for every allocated but unused IP hourly. By that, they want to prevent people &#8220;collecting&#8221; addresses, I guess. To assign the address you just received to your instance, simply run:</p>
<blockquote><p>
ec2-associate-address &#8211;region eu-west-1 -i i-11e11b1e 79.125.11.11
</p></blockquote>
<p>The i-<id> is your actual instance&#8217;s ID, where the last, dot-separated number is the IP you&#8217;ve received. And yes, those are fake numbers &#8211; so don&#8217;t even try. <img src='http://devilx.net/wp-content/plugins/smilies-themer/Riceballs/wink.png' alt=';]' class='wp-smiley' /> </p>
<p>Now it could take a bit for Amazon to reconfigure the instance, but as soon as it finished, you should be able to re-connect to the instance using the IP you just assigned to it.</p>
<p>As last task for today, let&#8217;s bundle up the image the way we have it now. Bundling an image allows you more than just eating up your credit card&#8217;s limit by dumping your S3 buckets. On the one hand, with bundles you can recover machines that crashed or lost data within a few blinks and on the other, you can created new instances out of a bundle (talking about &#8220;scalability&#8221;).</p>
<p>For bundling, we use the AMI tools we installed. First of all, let&#8217;s create a directory for the bundle:</p>
<blockquote><p>
mkdir /mnt/myimage
</p></blockquote>
<p>After that, run the bundle-vol-tool:</p>
<blockquote><p>
ec2-bundle-vol -k pk-<id>.pem -c cert-<id>.pem -s <bundle size in MB, e.g. 5000> -u <user-id, without dashes> -d /mnt/myimage/
</p></blockquote>
<p>This command takes several parameters for the private key, the certificate, the size of the resulting bundle in MB and your User-ID (without dashes). The User-ID can be found within your Account Information on Amazon&#8217;s EC2 site. The command should ask you, what architecture you&#8217;d like to bundle the system for &#8211; i386 should work out perfectly for what we&#8217;re doing. The following procedure could take some time, since the tool collections every peace of the system and builds a bundle into the directory we specified. As soon as the tool finished, we can upload our bundle to our S3-bucket:</p>
<blockquote><p>
ec2-upload-bundle &#8211;location EU -b <some unique bucket name>  -m /mnt/myimage/image.manifest.xml -a <access-key> -s <secret-key>
</p></blockquote>
<p>Again, we need to specify some credentials (our access-key and the secret-key) for the upload to work. Also, we need to pick a globally unique bucket-name for uploading the bundle, what shouldn&#8217;t be that hard as long as you don&#8217;t try stuff like &#8220;linux&#8221; or other common words. The bundle will then be uploaded to your (private) bucket, so you have it for later use.</p>
<p>From within the web-interface you could now simply create new instances out of the uploaded bundle, without even knowing how the actual system was set up or having the Amazon API tools installed on your client.</p>
<p>Cool stuff, enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ripped WRT54GL</title>
		<link>http://devilx.net/2008/11/04/ripped-wrt54gl/</link>
		<comments>http://devilx.net/2008/11/04/ripped-wrt54gl/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 21:52:09 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Hot Gear]]></category>
		<category><![CDATA[Life itself]]></category>
		<category><![CDATA[Linux and stuff ...]]></category>
		<category><![CDATA[New & Cool]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[Cool]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[FritzBox]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[LAN]]></category>
		<category><![CDATA[Linksys]]></category>
		<category><![CDATA[New]]></category>
		<category><![CDATA[OpenWRT]]></category>
		<category><![CDATA[PPPoE]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Tomato]]></category>
		<category><![CDATA[WAN]]></category>
		<category><![CDATA[WRT54GL]]></category>

		<guid isPermaLink="false">http://www.devilx.net/?p=600</guid>
		<description><![CDATA[  Today the new hardware for my DSL 3k line arrived and I also installed it already. Everything works out pretty good so far. Now, with the new hardware, my Linksys WRT54GL became available for playing and hacking, so I&#8217;ve &#8230; <a href="http://devilx.net/2008/11/04/ripped-wrt54gl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p> </p>
<div class="wp-caption alignleft" style="width: 250px"><img title="My Linksys WRT54GL - now running OpenWRT!" src="/~devilx/blog/wrt54gl.jpg" alt="My Linksys WRT54GL - now running OpenWRT!" width="240" height="180" /><p class="wp-caption-text">My Linksys WRT54GL - now running OpenWRT!</p></div>
<p>Today the new hardware for my DSL 3k line arrived and I also installed it already. Everything works out pretty good so far. Now, with the new hardware, my Linksys WRT54GL became available for playing and hacking, so I&#8217;ve just started by replacing the <a title="Tomato Firmware" href="http://www.polarcloud.com/tomato" target="_blank">Tomato Firmware</a> I&#8217;ve had on it by the latest OpenWRT &#8220;Kamikaze&#8221; release (&#8220;openwrt-wrt54g-2.6-squashfs.bin&#8221;) available for my router. The whole replacement works out pretty good and fast, using the regular &#8220;Upgrade&#8221; function provided by Tomato. The OpenWRT documentation said, that image would be installable through Linksys&#8217; regular upgrade-mechanism on the router&#8217;s stock interface, so I just tried it out with Tomato (since it&#8217;s mostly based on Linksys&#8217; original firmware) &#8211; and OpenWRT runs!</p>
<p> </p>
<p>The first thing I did was the reconfiguration of the WAN-Port to act as a DHCP-client instead of trying to establish PPPoE connections over it. Unfortunately I&#8217;ve seem to forgotten to configure the SSH service availability on that port. <img src='http://devilx.net/wp-content/plugins/smilies-themer/Riceballs/ermm.png' alt=':-/' class='wp-smiley' /> Tomorrow I&#8217;ll need to reconnect the router directly to my iMac using a LAN port and configure this feature. After that I&#8217;ll be able to keep it connected to my new router-hardware, on its LAN port.</p>
<p>I&#8217;ll see&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://devilx.net/2008/11/04/ripped-wrt54gl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RDP over SSH over HTTPS</title>
		<link>http://devilx.net/2007/01/12/rdp-over-ssh-over-https/</link>
		<comments>http://devilx.net/2007/01/12/rdp-over-ssh-over-https/#comments</comments>
		<pubDate>Fri, 12 Jan 2007 21:17:29 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Linux and stuff ...]]></category>
		<category><![CDATA[Mac and stuff ...]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[DarwinPorts]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[Jabber]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Proxy]]></category>
		<category><![CDATA[prtunnel]]></category>
		<category><![CDATA[RDP]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Tunnel]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.devilx.net/?p=271</guid>
		<description><![CDATA[Okay, tunneling unter Linux/Unix system definitely is a bit complicated &#8211; until you really understand the basics. Some day I was searching for a possibility to tunnel a RDP Session over a WWW-Proxy and I really couldn&#8217;t find anything useful &#8230; <a href="http://devilx.net/2007/01/12/rdp-over-ssh-over-https/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Okay, tunneling unter Linux/Unix system definitely is a bit complicated &#8211; until you really understand the basics. Some day I was searching for a possibility to tunnel a RDP Session over a WWW-Proxy and I really couldn&#8217;t find anything useful on Google or Yahoo!. After some more searching, asking and trying I finally figured out how this can be done.</p>
<p>First of all: You cannot tunnel RDP directly through a proxy. RDP doesn&#8217;t speak any HTTP(S) to make the proxy connect to the RDP-Server or anything else. So you&#8217;ll need an application, that surrounds this RDP datachannel with HTTP, prefferable HTTPS. I found <em>prtunnel</em> for my Mac on DarwinPorts. This software allows you to tunnel anything you want through an http/socks proxy by connecting to the proxy, making it connect (by sending HTTP commands) to the preffered host and open a local port for the application (e.g. rdesktop) to connect. Good, so let&#8217;s connect using prtunnel to myrdpmachine.com:3389 and be happy! &#8211; NAH. As soon as you&#8217;ll try that you&#8217;ll see that it&#8217;s not that simple. Most http-proxies do not allow CONNECTs to other ports than 80/443. So you can either set up your RDP daemon to use that port &#8211; never found that option in Windoze &#8211; or you can use an SSH jumphost, since it&#8217;s pretty simple to change the SSH port to 443. So, you connect with prtunnel to your SSH machine on port 443, where the SSH daemon runs, open an SSH tunnel through that machine to the myrdpmachine.com port 3389 and connect with your RDP client on localhost:. Okay, let&#8217;s stop the theory and begin with the practice:</p>
<p>Open three terminals and execute the following command on the first one:</p>
<pre>prtunnel -V -t http -H 'proxy address' -P 'proxy port' \
'port on local machine' 'remote host to connect to over proxy' \
'remote port, put SSHd on 443'</pre>
<p>Then, terminal #2 gets the following command: ssh -L&#8217;local tunneling port&#8217;:'destination host&#8217;:'destination port&#8217; -p &#8216;local port to connect to, the same given at prtunnel&#8217; &#8216;user&#8217;@localhost<br />
After that you can hapily run your <em>rdesktop localhost:&#8217;local tunneling port&#8217;</em> and start RDPing. To make the stuff even more clear, here a concrete example:</p>
<pre>prtunnel -V -t http -H 192.168.111.2 -P 3128 13337 192.168.111.3 443
ssh -L13338:192.168.111.24:3389 -p 13337 root@localhost
rdesktop localhost:13338</pre>
<p>That&#8217;s all the magic. Though, you need to pay attention when selecting your ports, because of course only free ports will work and you really should try to keep them higher than 1024 unless you want to become root. Also you need to remember that running an RDP session over HTTP(S) might get the attention of a firewall or whatever monitoring application is available in that network. &#8220;Abnormal behaviour&#8221; &#8211; you&#8217;d never get such an 50:50 up- and downtraffic unless you run some peer-2-peer application or remote desktops.</p>
<p>But of course you can modify the commands and use it to be able to connect to let&#8217;s say Jabber from a network where only 80/443-outgoing is available &#8211; all you need is a jumphost.</p>
]]></content:encoded>
			<wfw:commentRss>http://devilx.net/2007/01/12/rdp-over-ssh-over-https/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

