-
Notifications
You must be signed in to change notification settings - Fork 15
/
03-keypairs.txt
33 lines (23 loc) · 889 Bytes
/
03-keypairs.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Create a Nova keypair. Nova generates keypair, retains the public key, and returns the private key.
nova keypair-add mykeypair > mykeypair.pem
# Change private key permissions
chmod 600 mykeypair.pem
# Boot an instance with injected public key
nova boot --image cirros --flavor m1.summit --key-name mykeypair mykeypairinstance
# View console-log
nova console-log mykeypairinstance
# Get VNC console
nova get-vnc-console mykeypairinstance novnc
# Open the URL in your browser.
# username: cirros
# password: cubswin:)
# From the instance, query the Metadata service.
# You should be able to see the injected public key.
curl 169.254.169.254/openstack/latest/meta_data.json
# View the contents of the authorized_keys file
cat /home/cirros/.ssh/authorized_keys
# Log out of instance
exit
######!!!From Your SSH Session!!!######
# Delete the instance
nova delete mykeypairinstance