icehouse官方文档:
Launch an instance with OpenStack Networking(neutron)
To generate a keypair
Most cloud images support public key authentication rather than conventional username/password authentication. Before launching an instance, you must generate a public/private key pair using ssh-keygen and add the public key to your OpenStack environment.
2. Generate a key pair:
$ ssh-keygen
--------------------
[root@controller ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): #这里用什么密码? Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
1f:73:9d:f3:bb:37:29:6f:59:3b:ba:67:d3:6b:2d:10 root@controller
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| |
| E. . |
| S o ..+ |
| . +. o.|
| . . O|
| ..%=|
| oX*B|
+-----------------+
[root@controller ~]#
--------------------
3. Add the public key to your OpenStack environment:
$ nova keypair-add --pub-key ~/.ssh/id_rsa.pub demo-key
Note
This command provides no output.
4. Verify addition of the public key:
$ nova keypair-list
+----------+-------------------------------------------------+
| Name | Fingerprint |
+----------+-------------------------------------------------+
| demo-key | 6c:74:ec:3a:08:05:4e:9e:21:22:a6:dd:b2:62:b8:28 |
+----------+-------------------------------------------------+