]> andersk Git - gssapi-openssh.git/blame - openssh/regress/ssh2putty.sh
The man2html from jbasney on pkilab2 works whereas the standard one doesn't.
[gssapi-openssh.git] / openssh / regress / ssh2putty.sh
CommitLineData
e8439bd3 1#!/bin/sh
2
3if test "x$1" = "x" -o "x$2" = "x" -o "x$3" = "x" ; then
4 echo "Usage: ssh2putty hostname port ssh-private-key"
5 exit 1
6fi
7
8HOST=$1
9PORT=$2
10KEYFILE=$3
11
12# XXX - support DSA keys too
13if grep "BEGIN RSA PRIVATE KEY" $KEYFILE >/dev/null 2>&1 ; then
14 :
15else
16 echo "Unsupported private key format"
17 exit 1
18fi
19
20public_exponent=`
21 openssl rsa -noout -text -in $KEYFILE | grep ^publicExponent |
22 sed 's/.*(//;s/).*//'
23`
24test $? -ne 0 && exit 1
25
26modulus=`
27 openssl rsa -noout -modulus -in $KEYFILE | grep ^Modulus= |
28 sed 's/^Modulus=/0x/' | tr A-Z a-z
29`
30test $? -ne 0 && exit 1
31
32echo "rsa2@$PORT:$HOST $public_exponent,$modulus"
33
This page took 0.055521 seconds and 5 git commands to generate.