AdSense Mobile Ad

Monday, November 3, 2008

Connecting with SSH without typing a password

I'm heavily relying on some remote machines to get some jobs done so SSH is a tool I used daily. The downside of being sit in front of a terminal opening and closing many SSH connections is that you have to type in your password over and over again.

I started looking at SSH documentation hoping to find a way to ease this pain without trading off SSH inherent security. I'm using version 2.0 of the SSH protocol and the solution is authenticating using a key.

The first step is creating RSA private/public keys with a tool which comes with SSH:

$ ssh-keygen -t rsa


ssh-keygen will then produce the following files in the ~/.ssh directory: id_rsa and id_rsa.pub. The complete output of ssh-keygen is the following:

enrico@solaris:~$ ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/enrico/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/enrico/prova.
Your public key has been saved in /home/enrico/prova.pub.
The key fingerprint is:
23:63:25:1d:2a:0a:34:c8:47:d9:65:80:43:f6:c9:e8 enrico@solaris

Obviously, a good advice would be using a passphrase: please note that in this case SSH will be asking for user input and instead of your password you'll be typing your passphrase. In my case, I decided to use an empty passphrase and keep keys' files safe.

Once you have your keys generated, you have to copy the public key on every server you want to log on to. The content of id_rsa.pub is a line which must be appended to the .ssh/authorized_keys2 file. If this file does not exist, just create it copying id_rsa.pub in .ssh/authorized_keys2. Even if you use a passphrase, care should be taken to protect files in the .ssh directory. At most, this directory and its content should have 0600 permission level.

Now you have setup your environment and the sshd daemon on the server you log in will encrypt communications (2.0 protocol version) using the public key you provided and next time you'll log in via SSH to that server, you won't be asked your password any longer!

Wednesday, August 20, 2008

Setting up Subversion on Solaris 10

In this series of posts I'm going to describe how I set up Subversion on a Solaris 10 machine. The instructions here are valid for subsequent releases such as Solaris Express Community Edition (Nevada) and OpenSolaris (Indiana), the only difference being the fact that Subversion is bundled with the Operating System.

I decided to host some Subversion (1.4.5) repositories on a Solaris 10 (update 5) server so I downloaded Subversion packages from Blastwave and installation was done in less than 5 minutes with a simple:
# pkg-get -i subversion
Once Blastwave's installer was done, the first thing I wanted to do was registering Subversion's daemon (svnserve) in the Service Management Facility. Writing an SMF manifest is not so hard but fortunately I found a manifest and a management script in OpenSolaris website and the job was done! Great work, guys.

Next steps

You can now:

Thursday, May 8, 2008

VirtualBox 1.6.0 for OpenSolaris has been released

Sun xVM VirtualBox software 1.6.0 has been released and it's the first non-beta version for Solaris. I just removed the old 1.5.5 beta package, installed 1.6.0 with a quick pkgadd and VirtualBox is running perfectly without any hack, as I previously wrote here.

If you're upgrading from a previous version, as I did, pay attention to the warning in the download page:
Warning: saved states and snapshots are not compatible between different versions of VirtualBox. Merge all snapshots, restore all saved states and shutdown all VMs properly before attempting to upgrade.
Have fun with VirtualBox on your Solaris!

Loreena McKennitt - Penelope's song

Now that the time has come
Soon gone is the day
There upon some distant shore
You'll hear me say

Long as the day in the summer time
Deep as the wine-dark sea
I'll keep your heart with mine
Till you come to me

There like a bird I'd fly
High through the air
Reaching for the sun's full rays
Only to find you there

And in the night when our dreams are still
Or when the wind calls free
I'll keep your heart with mine
Till you come to me

Now that the time has come
Soon gone is the day
There upon some distant shore
You'll hear me say

Long as the day in the summer time
Deep as the wine-dark sea
I'll keep your heart with mine.
Till you come to me

Wednesday, May 7, 2008

Loreena McKennitt - Dante's prayer

When the dark wood fell before me
And all the paths were overgrown
When the priests of pride say there is no other way
I tilled the sorrows of stone

I did not believe because I could not see
Though you came to me in the night
When the dawn seemed forever lost
You showed me your love in the light of the stars

Cast your eyes on the ocean
Cast your soul to the sea
When the dark night seems endless
Please remember me

Then the mountain rose before me
By the deep well of desire
From the fountain of forgiveness
Beyond the ice and the fire

Cast your eyes on the ocean
Cast your soul to the sea
When the dark night seems endless
Please remember me

Though we share this humble path, alone
How fragile is the heart
Oh give these clay feet wings to fly
To touch the face of the stars

Breathe life into this feeble heart
Lift this mortal veil of fear
Take these crumbled hopes, etched with tears
We'll rise above these earthly cares

Cast your eyes on the ocean
Cast your soul to the sea
When the dark night seems endless
Please remember me.
Please remember me.
Please remember me.