LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-04-2008, 01:29 AM   #1
vonedaddy
Member
 
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 185

Rep: Reputation: 17
ssh private key question


I created a key auth with putty. I was wondering if I can use that key I created with putty in other programs like Secure CRT (which is the only thing they let us use in work).

As of right now it will not let me, it says file format invalid. But I was wondering if I can change something to make it work?

Also I have another linux box at my work (both boxes are fedora 8) could I use this key there?

Thanks
 
Old 01-04-2008, 03:31 AM   #2
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
yes, you can. If I remember correctly Putty adds extra junk at the beginning that you need to get rid of, so all you need to do is delete that and make sure the entire key entry is on one line. I suggest looking at an example key in Linux (from OpenSSH) and compare that to the format that Putty uses.

It's a quick edit and should only take a couple of seconds.
 
Old 01-04-2008, 11:36 AM   #3
vonedaddy
Member
 
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 185

Original Poster
Rep: Reputation: 17
hmm extra junk??

OK here is a sample from putty (of course I changed the characters)
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEA0kGkVYY9SVghdrthdrthTHDRTgergtFRFRTGTgtgTTGtgGTgegtgwefwjuk356yhyjsjygjh ukREFERFEFGRRgC5KQFxpsiIvQnuUCi6VSEtxTovGghlp64o3KsQcA1wcwh4tHhnyfHeDC32hCIvcym3aunFo3NjVYUUe9T2a2c= TEMPTATION

and here is a sample output from ssh-keygen -t rsa

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,340D0FE5549AD343

cJsdRPf7BMQJGyEcLrRgAohhtBFomr2WbVnrobo1Dc50tQT4nWIrbr2ZpNvXrTq5
rBX0DolvPMOp7S4+osvWUoCNrPBRC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WMr53i
pM0Xz2Nd0aSgiMWLQoOh+y6+MsVNpgI7PaacJsoRZ3W5xesw82JQqrhvdXUvDdv4
Ql/Vd6TIyEImRVSvNkfJtU7WbIKUMcE3D0EzeAqLXyaAf43astuduXeo3OyYp4E5
mkGmhKmw1jjz+rhPMRYtmZ0H7fpLDTTBqCtuSQRjqjRbBGz0ffOzqanFtZqToArZ
qNiJhhckr4mIG6hCOj1efy+ygevsVOUhrIvLSPuGany9ZB9ptWxLmr9j+hmHQUo8
y+azE23gYeAwHR4T0wHQZJIwBwkIHAq47vPCwIUWECMfFhyFFEhxyZ4P6ciQBnBW
pP2DtQeu0GlXFYyTdasbn34QL8EuxUm2vI8EqIPM1IsOjcE5FkkLP/ynd9rk22Bh
UzHM1OP9Nglu5zhCUAcLd9HI5n8uN+vp14Up2zJHlb+jUAvBxVF2SRUcdDLrBv/Q
-----END RSA PRIVATE KEY-----


and here is a sample from Secure CRT

---- BEGIN VAN DYKE SSH2 PRIVATE KEY ----
Subject: user
Comment: "TEMPTATION"
ModBitSize: 1024
AAAAAQAAAJcAAAAHc3NoLXJzYQAAAAMBAAEAAACBALflWwnkcdwUWpeQ7YLvoD4+NM25
hoT04431o1oVKLkMN7qKhajMi74+sytcKMfCKep9DrWVB3+fSG3jABmAF5yn8qe51O8Z
k6YqUn2i43b0UnQmAdPFopmEDlB29qQWBor5FbrxBhxm/bW9KcOvP750HdRPWp8Hosdw
tVDSmVmFAAAACmFlczEyOC1jYmMAAAKAvLm/wUbXU/Jznuxxf6B+m3r30pf4ouAvp3QX
z+DabqkT5ZJNUhL33vvSPTCnOLPJ3OUdoiwYqApqlThNysZEUljjjzY8NLEilocc9tZT
/GJIL5N20jbrPfk7ET37wz7da9i6gYKa5V9DTkTOs0JswOJi9KdV9YV5dGqMoJWnCq9Y
K4KHifq0tiEKCBOvGHMxaaLy5Gyzt/xZAursRNrQCA6aW/w/KBp78YIx1lUc4CXT4vkz
kmJeSjfdnpVnigjd36X4CO3wdW1sc9jC4l7q7DujOx7Fa0MVezGorMH+1qLwKcF/PuEE
oHnl0a+7drnWe+yvZdV9lEo0OZJNZZ2wMFMJp/D+ahxCLefdZGyluHgGKu0703hcrsB0
zg2OIdcwLb3juKFMSQjrKYiJNtwRJxuZfOXSMMy1XEKMRkI4JsmESKHmrdTC3FKNqVct
zEcfO23VqEldejzk8FV7/tmxVf8h++h6Xyub9NDtd/f0Yokbwl7euE4keFaLpUciO/hR
yasXfP64FdU8Mn8agmn6CZQvMycEntJlpKvFo0JYJ/g0sjXXI4WrwzwPmN5Klg7WDvAs
AY5sIBWEi/MJS6ffhkizVVMw1/T5SYtKskeoIS4pwGngCJsuGowHGwo11Zg3FG43YY/4
b//7n9RIG+8BizhvxqU4nmUYhPDlGE7LZIOSZnFvSJ+ycDyXApNjnFq2hNDRUNu3l8nb
f87amG039yZNOEA7CIF4JQgOPge5W/Tnx6Qtq+sK2jwYpvuPiHyh6rZxvM1/DNWcj5Dg
iX67wxiEGQtwqyg8x8Y4fAiMM1mS4JqBOLWhejHxoHzxKZZhy53Wi7pj2Ch6qraXAoWk
+AAAAI8AAAAHc3NoLXJzYQAAAICeS256pUV4XCrMhRMteRpYsx8yAFTc6Xo3x+wH+zWW
qUz0Ee09broP9Kh9B+9sMU2kmGFA0z3ifRAPXUu1qvdBDd6FF+tK0ybhLnOBQHJzNjdI
N42HTHqzXJabXppBc6sku1Kagk+u9Om51ps/qNnMIhJF7s6YGTUMkAdnDDd3aw==
---- END VAN DYKE SSH2 PRIVATE KEY ----


ANY IDEAS?
 
Old 01-13-2008, 09:34 AM   #4
mi6
Member
 
Registered: Jun 2003
Distribution: Fedora 9 64bit, RHEL 4.6
Posts: 96

Rep: Reputation: 15
edit: I re-read your post, here is a link that may help:
http://forums.vandyke.com/archive/index.php/t-844.html

Last edited by mi6; 01-13-2008 at 09:38 AM.
 
Old 01-14-2008, 11:41 AM   #5
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
vonedaddy,

sorry about the untimeliness of my response. For some reason I didn't get notified of an update to the thread until the most response (I probably accidentally deleted the email notification).

At any rate, could you please repost (or edit) the sample keys using CODE brackets so that they appear correctly.

You see, one of the difference between Putty formatted keys and others is that Putty formatted keys aren't on one line whereas many others are.

For example your Putty public key may look like

Code:
---- BEGIN SSH2 PUBLIC KEY ----
AAAAB3NzaC1yc2EAAAABJQAAAIEA0kGkVYY9SVghdrthdrthTHDRTgergtFRFRTG
TgtgTTGtgGTgegtgwefwjuk356yhyjsjygjhukREFERFEFGRRgC5KQFxpsiIvQnu
UCi6VSEtxTovGghlp64o3KsQcA1wcwh4tHhnyfHeDC32hCIvcym3aunFo3NjVYUU
e9T2a2c= TEMPTATION
---- END SSH2 PUBLIC KEY ----
and the corresponding OpenSSH public key would look like
Code:
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEA0kGkVYY9SVghdrthdrthTHDRTgergtFRFRTGTgtgTTGtgGTgegtgwefwjuk356yhyjsjygjhukREFERFEFGRRgC5KQFxpsiIvQnuUCi6VSEtxTovGghlp64o3KsQcA1wcwh4tHhnyfHeDC32hCIvcym3aunFo3NjVYUUe9T2a2c== TEMPTATION
I am assuming that your problem with Secure CRT is something similar to this and I apologize if this assumption is incorrect. By looking at the different formats and paying attention to how many lines there really are (use a editor with line wrapping turned off) you should be able to get it to work by making the files look as they should.

Last edited by shadowsnipes; 01-14-2008 at 11:45 AM. Reason: formatting...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh randomly not accepting my private key reeseslover531 Linux - Server 6 06-06-2010 07:40 PM
Private/Public key vs. Password authentication w/ SSH MykeV Linux - Security 5 11-25-2007 12:49 PM
need help with SSH private/public key taduser Linux - Security 2 04-02-2007 08:07 PM
SSH: Help needed adding private key thomsky Linux - Security 3 10-21-2006 06:04 PM
Can someone explain the basics of private-key authentication through SSH? lowpro2k3 Linux - Security 2 06-09-2005 12:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration