Ask Your Question
0

Fail to access an openstack instance

asked 2019-01-19 08:59:41 -0500

najeh gravatar image

updated 2019-01-21 08:37:32 -0500

I cannot access to any created instance:

ssh -i mykey.pem ubuntu@192.168.1.49

Load key "mykey.pem": invalid format ubuntu@192.168.1.49: Permission denied (publickey).

where is the problem and how can i solve it ?

The content of my new keypair:

    -----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAzIuhwuW4uKTwrhk1J2MMjEcXEwTo8G5nkBVcTHqki1YFX9i0
/kEHVwP5d9w07Scgwrz8/30JN8wtSzrf6etleUq/mvp9jhUxvHS5NVduBt8jrJ/S
HTTZ39F4jkSMFHHX2KlGWNLvzTx+nybx75VlSDdXqbyyn2OOCAk2KrKPL2b0nkD3
VnTt4QTZoUpFHM3ibYjE1eVCeXgcrtjd6QwOd8GY71CghglOSj87qA/y9V+5Ixwr
YMPKqFO+UOHL7PlkgpOOS/bh8w1EuTEu/RQDbxKvu8pe/GkA2tk3AkyhZZEmtszR
GvikEIcsJaddNJZu0t5cczBEcRtCiNEqUGTZGQIDAQABAoIBADCB9Ky5ueLgCsve
4oIitTkXKtux0GQkap760da5RwhcMA4Y4GNjnJAAO0s3h72uB9Dm7MDSMDtxSlSK
88sPrhLjrSjduqTVVeQxcjK6Nzed92HazQNsIzc2//YNP4MhtGSHUE2ESKZNcGHh
5IJC1bAYn8t7Gok+HNK/DH93tQkyXsb1Lca37VzFm/XtZgWi80e1hfRmU9NTcPer
gc9qhaDccyETRe5i+6nVvxUgKDui0dZzjZk9x3HV86MBU7aIS7yNNL0RnJR4ni72
G7x2UiH0F0cMu9dkaacvH53nuEQP1mJ3Vwm53Sc6iRi1EGdQC1zARM39iK49oil4
PWIhm+ECgYEA6QYlT+LdS3iWqh1yYRvb1E05D45fzoI/0l82kXTY0oHj5iLXAsSf
u3O6zo3IMwixtY1XCRAtSn1BK1098mNjZGpFo9navekzIOi7AZc2FZehJVBxUXma
O40a5XbPOTgWGn7DFrlcdiKvnwoYPdB4iwF0CBqC5dWPZWgU94SK4q0CgYEA4Lal
m3ZD/aYEjuzxKKPMtzY0iSMU6oATwG0koTN2MKvPEmg5EHf3p+hysA+31RPMdkWH
7NXR0dccXeXSME/FVcQFScc6lfynufFEnp0UE9pwCbmnNjn3cCcWqJA2Lm6j48KI
7dqHaSzu1iedEniiA11DsdWXayEw3lyNke32yZ0CgYAQMiAnxEHTPAdkvXU0sKX/
xHpBzYh1JvJeocV+KJvlTafUV/mPtLDRa4LBVnNisKkBUFiLRbeQJNKBvBJRJX1D
/mrmr36Xkny+Pc65lpPovkgx+rxViFki6HTFHBPdCzvmDYdrrehyQYjpSd9TdIjc
SHaTFZyhcs1ro+dJKMoqZQKBgFnTCM3k73az5zyOoDOjjlBqHYP3/wNh4QNZXXwG
iycXdnWgLbdUjS2UMEwKbGyDNobMcnIMYovj1dX+6Q8gw/vtmEOOnO+ZiB4+wDQ7
C+yHs6Nfj+SQNUWiil8lDlNvLJn9iCiz4s77BBmcyh+5EuIPZODwRU+we81W58w+
eBjNAoGAF/PgyUrvLkh3rVx8JrflvIwd21s6eBtGZNS8OClrn+1DMLyTKff6p/yE
AeJtflspK5J1Bdt4N7jqG17/mPIpxB9iw/DJo4GAIFDycGAjQvXjUp9xfBHie92U
WOFeB9XHX6SBFD7OMjNXYyTdmgBY5AVyl/zozmdb1W/0iUzPMvQ=
-----END RSA PRIVATE KEY-----
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2019-01-19 17:05:32 -0500

updated 2019-01-19 21:45:32 -0500

Something is wrong with your private key. If you want me to confirm this, edit your question and add the key file’s content (format it as code, please, using the "101010" button).

Also check the key file's permissions: They should be 0600 or 0400 (no permissions for group and other).

If you don't have a correct private key that matches the public key on the instance, and the instance doesn't allow password-based login, there is nothing you can do to access this instance. Create a new key pair and launch a new instance.

By the way, if you don't mind my advice: The internet is a great resource to find answers. Searching for ssh load key invalid formatyields many useful results, including https://serverfault.com/questions/854.... This is faster than typing something into ask.openstack.org and waiting for an answer.

edit flag offensive delete link more

Comments

@Bernd Bausch I found mykey.pem empty

najeh gravatar imagenajeh ( 2019-01-21 03:18:06 -0500 )edit

i create a new keypair but i couldn't launch any instance with the new one. I recived these errors:

openstack.exceptions.ResourceFailure: Server:0c9e4222-b723-48b5-a7fb-8b67ddc83f9f transitioned to failure state ERROR

najeh gravatar imagenajeh ( 2019-01-21 04:02:50 -0500 )edit

openstack server show id display this error:

{u'message': u'No valid host was found. ', u'code': 500, u'created': u'2019-01-21T10:13:06Z'}

najeh gravatar imagenajeh ( 2019-01-21 04:14:41 -0500 )edit

This has nothing to do with your key. You don't have enough capacity on your compute hosts, or something else prevents the scheduler from finding a suitable host.

Bernd Bausch gravatar imageBernd Bausch ( 2019-01-21 08:38:27 -0500 )edit

I found this on the internet: You can validate your private key with ssh-keygen -y -e -f KEYFILE. This command generates the matching public key.

Bernd Bausch gravatar imageBernd Bausch ( 2019-01-21 08:39:14 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-01-19 08:59:41 -0500

Seen: 57 times

Last updated: Jan 21