Hi, there's something that's been confusing me for a long time. When connecting using public/private key authentication the client shouldn't need to have the public key available, but for some reason Capistrano (Net:SSH?) seems to require it.
The openssh client can connect without having the public key file available, e.g. "ssh -i privkeyfile hostname" (where privkeyfile is a private key). But Capistrano complains if there isn't also a file named "privkeyfile.pub" (containing the public key) in the same directory.
Am I doing something wrong? Is there a way to change this so that the public key isn't required?
It's a quirk of Net::SSH that has never been patched. If anyone wants to take a look and fix it, that'd be great. The problem might already be fixed in Net::SSH v2 (due to be released in the near future), but I haven't had a chance to verify.
> Hi, there's something that's been confusing me for a long time. When > connecting using public/private key authentication the client > shouldn't need to have the public key available, but for some reason > Capistrano (Net:SSH?) seems to require it.
> The openssh client can connect without having the public key file > available, e.g. "ssh -i privkeyfile hostname" (where privkeyfile is a > private key). But Capistrano complains if there isn't also a file > named "privkeyfile.pub" (containing the public key) in the same > directory.
> Am I doing something wrong? Is there a way to change this so that the > public key isn't required?
> Thanks, > Paul
> --~--~---------~--~----~------------~-------~--~----~ > To unsubscribe from this group, send email to capistrano-unsubscribe@googlegroups.com > For more options, visit this group at http://groups.google.com/group/capistrano > -~----------~----~----~----~------~----~------~--~---
On Sat, Apr 12, 2008 at 10:39 AM, Jamis Buck <ja...@37signals.com> wrote: > It's a quirk of Net::SSH that has never been patched. If anyone wants to > take a look and fix it, that'd be great. The problem might already be fixed > in Net::SSH v2 (due to be released in the near future), but I haven't had a > chance to verify.
> - Jamis
> On Apr 12, 2008, at 8:07 AM, Paul Dowman wrote:
> > Hi, there's something that's been confusing me for a long time. When > > connecting using public/private key authentication the client > > shouldn't need to have the public key available, but for some reason > > Capistrano (Net:SSH?) seems to require it.
> > The openssh client can connect without having the public key file > > available, e.g. "ssh -i privkeyfile hostname" (where privkeyfile is a > > private key). But Capistrano complains if there isn't also a file > > named "privkeyfile.pub" (containing the public key) in the same > > directory.
> > Am I doing something wrong? Is there a way to change this so that the > > public key isn't required?
> I'd be willing to take a crack at it if you can point me in the right > direction and if it's not fixed in v2.
> Paul
> On Sat, Apr 12, 2008 at 10:39 AM, Jamis Buck <ja...@37signals.com> > wrote: >> It's a quirk of Net::SSH that has never been patched. If anyone >> wants to >> take a look and fix it, that'd be great. The problem might already >> be fixed >> in Net::SSH v2 (due to be released in the near future), but I >> haven't had a >> chance to verify.
>> - Jamis
>> On Apr 12, 2008, at 8:07 AM, Paul Dowman wrote:
>>> Hi, there's something that's been confusing me for a long time. When >>> connecting using public/private key authentication the client >>> shouldn't need to have the public key available, but for some reason >>> Capistrano (Net:SSH?) seems to require it.
>>> The openssh client can connect without having the public key file >>> available, e.g. "ssh -i privkeyfile hostname" (where privkeyfile >>> is a >>> private key). But Capistrano complains if there isn't also a file >>> named "privkeyfile.pub" (containing the public key) in the same >>> directory.
>>> Am I doing something wrong? Is there a way to change this so that >>> the >>> public key isn't required?
> --~--~---------~--~----~------------~-------~--~----~ > To unsubscribe from this group, send email to capistrano-unsubscribe@googlegroups.com > For more options, visit this group at http://groups.google.com/group/capistrano > -~----------~----~----~----~------~----~------~--~---
The fact that this works, even if I don't currently have a public key file available, proves that the ssh private key format, at least, contains the information necessary to generate a public key. Therefore, I would think that a quick fix might be to find out how ssh does that, and simply generate a public key when needed.
> And search the code for places KeyFactory is used, to determine when/where > public keys are being used where private keys would do.
> - Jamis
> On Apr 14, 2008, at 8:02 AM, Paul Dowman wrote:
> > I'd be willing to take a crack at it if you can point me in the right > > direction and if it's not fixed in v2.
> > Paul
> > On Sat, Apr 12, 2008 at 10:39 AM, Jamis Buck <ja...@37signals.com> > > wrote:
> > > It's a quirk of Net::SSH that has never been patched. If anyone wants > > > to > > > take a look and fix it, that'd be great. The problem might already be > > > fixed > > > in Net::SSH v2 (due to be released in the near future), but I haven't > > > had a > > > chance to verify.
> > > - Jamis
> > > On Apr 12, 2008, at 8:07 AM, Paul Dowman wrote:
> > > > Hi, there's something that's been confusing me for a long time. When > > > > connecting using public/private key authentication the client > > > > shouldn't need to have the public key available, but for some reason > > > > Capistrano (Net:SSH?) seems to require it.
> > > > The openssh client can connect without having the public key file > > > > available, e.g. "ssh -i privkeyfile hostname" (where privkeyfile is > > > > a > > > > private key). But Capistrano complains if there isn't also a file > > > > named "privkeyfile.pub" (containing the public key) in the same > > > > directory.
> > > > Am I doing something wrong? Is there a way to change this so that > > > > the > > > > public key isn't required?
> And search the code for places KeyFactory is used, to determine when/where > public keys are being used where private keys would do.
> - Jamis
> On Apr 14, 2008, at 8:02 AM, Paul Dowman wrote:
> > I'd be willing to take a crack at it if you can point me in the right > > direction and if it's not fixed in v2.
> > Paul
> > On Sat, Apr 12, 2008 at 10:39 AM, Jamis Buck <ja...@37signals.com> wrote:
> > > It's a quirk of Net::SSH that has never been patched. If anyone wants to > > > take a look and fix it, that'd be great. The problem might already be > fixed > > > in Net::SSH v2 (due to be released in the near future), but I haven't > had a > > > chance to verify.
> > > - Jamis
> > > On Apr 12, 2008, at 8:07 AM, Paul Dowman wrote:
> > > > Hi, there's something that's been confusing me for a long time. When > > > > connecting using public/private key authentication the client > > > > shouldn't need to have the public key available, but for some reason > > > > Capistrano (Net:SSH?) seems to require it.
> > > > The openssh client can connect without having the public key file > > > > available, e.g. "ssh -i privkeyfile hostname" (where privkeyfile is a > > > > private key). But Capistrano complains if there isn't also a file > > > > named "privkeyfile.pub" (containing the public key) in the same > > > > directory.
> > > > Am I doing something wrong? Is there a way to change this so that the > > > > public key isn't required?
> The fact that this works, even if I don't currently have a public > key file available, proves that the ssh private key format, at > least, contains the information necessary to generate a public key. > Therefore, I would think that a quick fix might be to find out how > ssh does that, and simply generate a public key when needed.
From the man-page of ssh-keygen of OpenSSH:
-y This option will read a private OpenSSH format file and print an OpenSSH public key to stdout.
You will need to supply the private key password to load it.