New Reply

ssh-keygen problem

 
Share Thread
Jul14-12, 11:31 AM   #1
 
Admin

ssh-keygen problem


I have a private key file used to log into remote servers. As the file resides only on a desktop computer, key file was prepared without a passphrase (or at least that's what I remember and I am never asked to enter a passphrase when I use ssh, which makes me think I remember right). However, now I am going on a trip and I want to be able to use the same key on my laptop - so to be safe I wanted to add a passphrase. Judging from the man page to change a passphrase I should use something like

ssh-keygen -p -f id_rsa_priv.ppk

but it doesn't work - that is, I am asked to enter the old passphrase, but when I just press Enter I am told it is a bad one. Any ideas what should I do? I already tried using -P "" to no avail.
PhysOrg.com science news on PhysOrg.com

>> New language discovery reveals linguistic insights
>> US official: Solar plane to help ground energy use (Update)
>> Four microphones, computer algorithm enough to produce 3-D model of simple, convex room
Jul14-12, 12:50 PM   #2
 
Recognitions:
Homework Helper Homework Help
When I first generate a key with an empty pass phrase (with just $ ssh-keygen), I can change it with:
$ ssh-keygen -p -f id_rsa
When I do, it does not ask for the old pass phrase, but just for a new one.
If I repeat it, it asks for the old pass phrase that I had just entered as new phrase.

Seems to me that you do have an old pass phrase, but apparently you do not know it any more.
Although that doesn't really explain why it usually doesn't ask for a pass phrase.
Can it perhaps be that there is another key-pair involved that allows you to log in without pass phrase?

Anyway, easiest way to resolve it, is by preparing new key-pairs, and dropping off the public keys at your remote servers in the authorized_keys file.
(Note that public key files and the authorized_keys file are just text files that you can edit.)
Jul14-12, 12:56 PM   #3
 
Blog Entries: 9
Recognitions:
Gold Membership Gold Member
Try:
Code:
# ssh-keygen -p -f id_rsa_priv.ppk -N newpasswd
Another option you could consider is generating a second ssh key for your laptop to use while travelling and then revoke it after you get back.
Jul14-12, 01:03 PM   #4
 
Recognitions:
Homework Helper Homework Help

ssh-keygen problem


Btw, are you using PuTTY or something?
I seem to recall that it typically generates files with the .ppk extension.
Typically with PuTTY things are a little less straight forward than with native linux tools.
Jul14-12, 01:39 PM   #5
 
Admin
Quote by jhae2.718 View Post
Try:
Code:
# ssh-keygen -p -f id_rsa_priv.ppk -N newpasswd
Tried that as well, didn't work. Asks for a passphrase.

Quote by I like Serena View Post
Btw, are you using PuTTY or something?
I seem to recall that it typically generates files with the .ppk extension.
Typically with PuTTY things are a little less straight forward than with native linux tools.
PuTTy on windows, but I am using exactly the same key file with ssh on a Linux machine.

But your question suggested a solution. ssh-keygen was not able to add a passphrase, while puttygen did it without a problem. Apparently just because a key file works OK with ssh doesn't mean it works OK with ssh-keygen.

Why do I still feel surprised by such things after programming for 30 years

Thank you! Case closed.
New Reply

Similar Threads for: ssh-keygen problem
Thread Forum Replies
general mathematics problem on time taken to fill tank with pipes ,problem is below General Math 2
Data Management: Premutations Problem With Some identical Items Chapter Problem Set Theory, Logic, Probability, Statistics 0
Physics problem: Radial acceleration, forces, and work & energy problem Introductory Physics Homework 13
One Kinematic Problem, One Pendulum Problem, One Wave Problem Introductory Physics Homework 7
classic E&M problem: point charge and a charged sphere, how to analyze this problem Advanced Physics Homework 1