Colin Harrington

Tag: iPhone

SSH without passwords (Public/Private Keys)

by on Oct.03, 2011, under Linux, Ubuntu

Secure Public/Private Key Cryptography isn’t exactly new stuff in the world of Computing. It makes our world go round. It is the basis for secure communication in today’s world. HTTPS, SSL, TLS, SSH are all cryptographic protocols that use Public/Private key infrastructures. Without these protocols, we would think twice about using credit card, banking or any other sensitive information on the Internet.

We all know that passwords aren’t very secure. If you choose a password that is easy to remember then its easier to guess via brute force. If you choose a password that is random or hard to remember then you are more likely to write it down. Any well-versed digital community member already has many username/password credentials to remember so we are less likely to remember extremely difficult random passwords. This is the password paradox, which leads me to look into managing access via public/private key pairs instead.

Generate a public/private key pair (if you don’t have one already)

Github has an excellent tutorial with good illustrations on how to generate ssh keys with ssh-keygen, but here is an overview:

  • *Backup your existing keys* — if they exists so that you don’t overwrite them.
  • generate a new key with ssh-keygen

Definitely setup a passphrase! – Its like a password for your private key. The passphrase is a second line of defence if anyone were to acquire your private key.

The .pub is your public key, you can safely share this anywhere, whereas the private key is entirely private! DO NOT show anyone, don’t copy it anywhere and only securely back it up.. This is your new password and large liability if it fell into the wrong hands.

Example:
Some folks like to generate and manage keypairs for each location, or at least manage certain levels of keys, but I’m not going to dive into that topic.

Configure the Server (if needed)

Make sure that the server has Public key authentication enabled (most do). for OpenSSH it would be the following in the sshd_config:

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

Then all you have to do is:

  • Put your public key (the one ending in .pub) as a line in the ~/.ssh/authorized_keys file (create it if it doesn’t exist)
  • Restart your SSH server
  • Log in without being prompted for a password

This is really handy for managing servers especially on Amazon’s EC2, local access between machines, SFTP, SSH tunneling, or even getting access to a jailbroken iPhone or any other device with OpenSSH installed on it.

The guys over at debian-administrator.org wrote a good guide to Password-less logins with OpenSSH that is worth looking into if you have issues or want to dive deeper.

Passwords aren’t very secure, you already know this. If you use one that’s easy to remember, it’s easier to guess or brute-force (try many options until one works). If you use one that’s random it’s hard to remember, and thus you’re more inclined to write the password down. Both of these are Very Bad Things™. This is why you’re using ssh keys.
3 Comments :, , , more...

Greasemonkey + live.gizmodo.com

by on Mar.17, 2009, under General

iphone2The Keynote for iPhone 3.0 just got over and I thought I should share a tiny greasemonkey script that I put together to reload http://live.gizmodo.com/ much sooner than the 90 seconds that one would wait.

It is too bad that macrumorslive.com is out of buisiness since they got hacked this past January.  Their application wasn’t too hard to mashup either.  It was simply changing a timout var in one version and then changing an obfuscated function later.

So the Greasemonkey script is really a breeze, it simply loads jQuery, hides the banner/space-waster and sets a timer to reload the page after 15 seconds (15000 milliseconds…) 

// ==UserScript==
// @name           live.gizmodo.com
// @namespace      live.gizmodo.com
// @description    live.gizmodo.com
// @include        http://live.gizmodo.com/
// ==/UserScript==

// Add jQuery
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://jquery.com/src/jquery-latest.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);

// Check if jQuery's loaded
function GM_wait() {
    if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); }
else { $ = unsafeWindow.jQuery; letsJQuery(); }
}
GM_wait();


// All your GM code must be inside this function
function letsJQuery() {
	$('#header_container').hide()
    setTimeout(function(){ window.location.reload(true);}, 15000);
}
2 Comments :, , more...

Silverlight on the iPhone Hints?

by on Mar.06, 2008, under RIA, Silverlight

As Mix ’08 is currently going on.  Scott Guthrie said something that peaked my interest.

He basically said that

"Our goal is to try to get it on as many mobile devices and allow you to just take advantage of it umm with a variety of different clients… Everything that has an SDK"

He was very hesitant when he said it.  Did he allude to Silverlight iPhone??  The timing is impecable.  He said this on Wednesday March 5th 2008, where the Apple event is today March 6th 2008.

You can view what he said by accessing http://wm.istreamplanet.com/customers/ms/750_microsoft_mix_080305.asx in Windows Media Player or VLC or other compatible player.  He said it at 2:26:00

I wonder if Adobe has something between Desktop Flash and Flash Lite?  I would still like to see flash on the iPhone, Maybe the iPhone SDK will allow that?

Only time will tell…

 

2 Comments :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!