Ssh Tectia

Overview

This article describes configuring OpenSsh to SSH Tectia public and private keys in RapidDeploy, MidVision�s Application Release Automation Tool

Why We Need to Do This

The Java Jsch SSHEXEC module does not support the SSH-Tectia format private keys. Worse, if connecting from OpenSSH on the build server to OpenSSH on the target then using SSH-Tectia for further SSH connections to perform further downstream tasks, the close event of SSH-Tectia also closes the connection from the build server, ending the deployment.

Fortunately there is a solution

The Solution

Create a connection from OpenSSH client on the build server to SSH-Tectia on the Deployment Manager

Step-by-Step

Create an OpenSSH Public/Private key pair as follows. Next, convert the public key to SSH-Tectia format - here we are using a remote user called "jxadmin":

cd /users/jxadmin/.ssh
/usr/local/openssh/bin/ssh-keygen -t rsa -b 1024 -f id_rsa_1024_jxadmin_RapidDeploy_a
Enter a passphrase � note this down

Next, convert the public key to SSH-Tectia format:

ssh-keygen -e -f id_rsa_1024_jxadmin_RapidDeploy_a.pub > id_rsa_1024_jxadmin_tect_RapidDeploy_a.pub

Copy this public key to the remote hosts jxadmin SSH2 (Tectia) directory such as /home/jxadmin/.ssh2 Edit the authorization file on the DM host in the .ssh2 directory, adding the public key:

Key id_rsa_1024_jxadmin_tect_RapidDeploy_a.pub

Amend the server configuration in RapidDeploy. Select SSH enabled. Enter the public key in the .ssh directory on the Build server BUT select the port of the SSH-Tectia NOT OpenSSH server on the DM. Enter the passphrase for the key in the textbox provided.

Testing the connection

Here is an example command to test this works before doing a deployment:

jxadmin@mvcloud01:(mvenv02):/users/jxadmin/.ssh $ ssh -p 22 -K id_rsa_1024_jxadmin_RapidDeploy_a mvcloud122
Enter passphrase for key "id_rsa_1024_jxadmin_RapidDeploy_a":
Last login: Thu Feb 19 2009 16:37:31 from mvcloud01.midvision.co.uk

Notes

Problem:

The key is not accepted on the target server. You get a password prompt.

Resolution:

Change the permissions of the public key you copied to the target server as follows:

chmod 640 id_rsa_1024_jxadmin_tect_RapidDeploy_a.pub

Retry the connection.