Discussion:
connecting to dropbear (ssh) server with public key authentication
CC Ma
2012-01-10 23:48:57 UTC
Permalink
So I generated a public key and private key pair on my ubuntu host
using dsa, copied and pasted the public key's content to my
beagleboard's ~/.ssh/authorized_keys file.

However, I still couldn't connect to my beagleboard using just the
public key authentication.

I tried copying the content over to ~/.ssh/authorized_keys2, /etc/
dropbear/authorized_keys, and /etc/dropbear/authorized_keys2, but I
still failed to connect via public key authentication.

I made sure all my authorized_keys or authorized_keys2 files were
chmod 0700 and their containing directories chmod 0600.

My running dropbear on beagleboard is:
/usr/sbin/dropbear -s -r /etc/dropbear/dropbear_rsa_host_key -p 22

The the final few lines of my debug output I get when connecting is
(ssh -vv -i ~/.ssh/id_dsa ***@beagleboard):
..........................
........................
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: id_dsa.pub (0x7fd08146c480)
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: id_dsa.pub
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).


Does any one know how to resolve this problem?

thanks
--
You received this message because you are subscribed to the Google Groups "Beagle Board" group.
To post to this group, send email to beagleboard-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to beagleboard+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/beagleboard?hl=en.
Gary Thomas
2012-01-11 11:59:46 UTC
Permalink
Post by CC Ma
So I generated a public key and private key pair on my ubuntu host
using dsa, copied and pasted the public key's content to my
beagleboard's ~/.ssh/authorized_keys file.
However, I still couldn't connect to my beagleboard using just the
public key authentication.
I tried copying the content over to ~/.ssh/authorized_keys2, /etc/
dropbear/authorized_keys, and /etc/dropbear/authorized_keys2, but I
still failed to connect via public key authentication.
I made sure all my authorized_keys or authorized_keys2 files were
chmod 0700 and their containing directories chmod 0600.
/usr/sbin/dropbear -s -r /etc/dropbear/dropbear_rsa_host_key -p 22
The the final few lines of my debug output I get when connecting is
..........................
........................
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: id_dsa.pub (0x7fd08146c480)
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: id_dsa.pub
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
Does any one know how to resolve this problem?
You need to convert the key generated on your Ubuntu system (which is
in openssh format) to the format used by dropbear. Something like this:
# dropbearconvert openssh dropbear openssh.key dropbear.key
Then provide the converted key to dropbear as you tried above.
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
You received this message because you are subscribed to the Google Groups "Beagle Board" group.
To post to this group, send email to beagleboard-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to beagleboard+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/beagleboard?hl=en.
CC Ma
2012-01-12 21:09:57 UTC
Permalink
So, I did the other way around and it didn't work.

I tried first generating the ssh keys on the beagleboard by:
dropbearkey -t rsa -f id_rsa
dropbearkey -f id_rsa -y > id_rsa.pub

The above gave the private key id_rsa and public key id_rsa.pub

I copied over the content of the id_rsa.pub to authorized_keys file in
~/.ssh

Then I convert the private key from dropbear format to openssh format
by
dropbearconvert dropbear openssh id_rsa id_rsa_openssh

Finally, I moved over the id_rsa_openssh private key to my ubuntu
laptop and ssh to my beagleboard with that private key. I still got
the same error as I had in the first post. :-(

Any idea on this?
Post by Gary Thomas
Post by CC Ma
So I generated a public key and private key pair on my ubuntu host
using dsa, copied and pasted the public key's content to my
beagleboard's ~/.ssh/authorized_keys file.
However, I still couldn't connect to my beagleboard using just the
public key authentication.
I tried copying the content over to ~/.ssh/authorized_keys2, /etc/
dropbear/authorized_keys, and /etc/dropbear/authorized_keys2, but I
still failed to connect via public key authentication.
I made sure all my authorized_keys or authorized_keys2 files were
chmod 0700 and their containing directories chmod 0600.
/usr/sbin/dropbear -s -r /etc/dropbear/dropbear_rsa_host_key -p 22
The the final few lines of my debug output I get when connecting is
..........................
........................
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: id_dsa.pub (0x7fd08146c480)
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: id_dsa.pub
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
Does any one know how to resolve this problem?
You need to convert the key generated on your Ubuntu system (which is
   # dropbearconvert openssh dropbear openssh.key dropbear.key
Then provide the converted key to dropbear as you tried above.
--
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
--
You received this message because you are subscribed to the Google Groups "Beagle Board" group.
To post to this group, send email to beagleboard-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to beagleboard+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/beagleboard?hl=en.
Mark A. Yoder
2012-01-11 22:51:06 UTC
Permalink
From what I read the public keys are the same for dropbear and openssh. I
think there's a different problem here, (I'm having it too), but I'm not
sure where.

Any other ideas?

--Mark
--
You received this message because you are subscribed to the Google Groups "Beagle Board" group.
To view this discussion on the web visit https://groups.google.com/d/msg/beagleboard/-/1ZlBJTrzQpEJ.
To post to this group, send email to beagleboard-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to beagleboard+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/beagleboard?hl=en.
CC Ma
2012-01-12 21:39:12 UTC
Permalink
Alternatively, would using openssh solve the problem?
From what I read the public keys are the same for dropbear and openssh.  I
think there's a different problem here, (I'm having it too), but I'm not
sure where.
Any other ideas?
--Mark
--
You received this message because you are subscribed to the Google Groups "Beagle Board" group.
To post to this group, send email to beagleboard-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to beagleboard+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/beagleboard?hl=en.
Dan
2012-01-12 23:10:36 UTC
Permalink
For what it's worth, dropbear public key authentication works for me
on both my -XM running Angstrom (dropbear version 0.52) and my
Beaglebone running Angstrom (version v2011.54). All I had to do to
enable it was to copy the authorized_keys file from another server to
my user-ID's ~/.ssh directory. However, I'm connecting from WinPuTTY,
not an OpenSSH client.

So, the problem is probably with the public or private key format.
The public keys that I store in .ssh/authorized_keys are in a format
that begins with "ssh-rsa AAAA...". I remember having to try a few
formats with dropbear before getting it to work.

Another, less likely, possibility is that there are settings in your /
etc/default/dropbear file, if one exists, that are interfering with
public key authentication.

Dan.
Post by CC Ma
Alternatively, would using openssh solve the problem?
From what I read the public keys are the same for dropbear and openssh.  I
think there's a different problem here, (I'm having it too), but I'm not
sure where.
Any other ideas?
--Mark
--
You received this message because you are subscribed to the Google Groups "Beagle Board" group.
To post to this group, send email to beagleboard-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to beagleboard+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/beagleboard?hl=en.
Loading...