VMware Cloud Community
Phylum
Enthusiast
Enthusiast
Jump to solution

[SOLVED] How to create public keys to ssh from ESXi to another host?

I've perused a number of different sites trying to find information on how to do this properly but I've not had any luck.  I'm afraid at this point I'm all mixed up and/or I'm missing something [painfully] simple.

My goal is to create some keys so that I can ssh/scp, as root, from the ESXi server to another linux/unix server as a different user.  Most, if not all, of the sites I found today cover the reverse: ssh/scp from another machine to the ESXi server.  I presume ssh ESXi -> Another host via keys is possible...?

I want to believe I'm almost there but in all honesty, I don't know.  Here's what I've done so far.

  • created RSA & DSA dropbear keys on the ESXi server
  • converted the RSA & DSA dropbear keys to ssh format
  • cat'd the RSA & DSA public keys into the ~/.ssh/authorized_keys on the server I wish to ssh/scp into
    • even tried making a copy of authorized_keys as authorized_keys2 on the destination server
    • even cat'd the public keys into the ESXi's authorized_keys & authorized_keys2
  • went as far as copying the private keys (!) from the ESXi server to the server I'm rying to ssh/scp into

As for the box I'm remoting into I

  • generated keys via ssh-keygen -t dsa and rsa
  • typed in a passphrase
  • cat'd the public keys into the .ssh/authorized_keys on the ESXi box
    • as above in desperation I added it to the local authorized_keys
    • copied authorized_keys to authorized_keys2
  • copied the private keys (!) from the destination machine to the ESXi box

I tried ssh -l username FQDN, ssh username@FQDN and with the IP itself, each time I was prompted for a password.  Naturally if I just do ssh hostname it tries to connect as root which isn't allowed & will fail.  Again, I apologize as I'm probably all mixed up now; might be wise to just erase all the keys & start from scratch.

Is this possible?

Is anyone interested in lending a hand?

Resources

http://communities.vmware.com/message/1373428#1373428

http://communities.vmware.com/docs/DOC-8890

http://pkeck.myweb.uga.edu/ssh/

http://computerpr0n.com/2011/04/esxi-remote-management-part-2/

http://oreilly.com/pub/h/66

0 Kudos
1 Solution

Accepted Solutions
mcowger
Immortal
Immortal
Jump to solution

I blogged about this recently:

http://blog.cowger.us/?p=15

--Matt VCDX #52 blog.cowger.us

View solution in original post

0 Kudos
2 Replies
mcowger
Immortal
Immortal
Jump to solution

I blogged about this recently:

http://blog.cowger.us/?p=15

--Matt VCDX #52 blog.cowger.us
0 Kudos
Phylum
Enthusiast
Enthusiast
Jump to solution

Awesome - worked like a charm.

I had previously created the ssh link in order to get rsync to work properly but, and here's the kicker, I wasn't using -i when ssh'ing.

Thank you so much!  After hours of checking & testing, I was up in less than 1 minute.

Thank you again so so very much.

0 Kudos