[root@openstack1 opt]# openstack server add floating ip ubuntu 192.168.123.168
[root@openstack1 opt]# ssh ubuntu@192.168.123.168
The authenticity of host '192.168.123.168 (192.168.123.168)' can't be established.
ECDSA key fingerprint is SHA256:U9W/IXHQ0+WtchdaehCI2o1sE2yUw+M1kgnth2byd+Q.
ECDSA key fingerprint is MD5:a6:6a:7c:74:e7:28:3c:74:fc:68:b1:9b:f4:10:e8:58.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.123.168' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-204-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Sun Feb 12 15:27:10 UTC 2023
System load: 0.0 Processes: 81
Usage of /: 2.3% of 48.27GB Users logged in: 0
Memory usage: 12% IP address for ens3: 172.16.1.10
Swap usage: 0%
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.
Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@ubuntu:~$
复制代码
5, 在假造机内部检察日志,可以看到cloud-init初始化使用秘钥的日志:
Feb 12 15:12:05 ubuntu systemd[1]: Started Update UTMP about System Runlevel Changes.
Feb 12 15:12:06 ubuntu cloud-init: #############################################################
Feb 12 15:12:06 ubuntu cloud-init: -----BEGIN SSH HOST KEY FINGERPRINTS-----
Feb 12 15:12:06 ubuntu cloud-init: 1024 SHA256:ssYh7n67IsNn0QYUmLoC7tL6JTLPAnr8a2x47tp4X4o root@ubuntu (DSA)
Feb 12 15:12:06 ubuntu cloud-init: 256 SHA256:U9W/IXHQ0+WtchdaehCI2o1sE2yUw+M1kgnth2byd+Q root@ubuntu (ECDSA)
Feb 12 15:12:06 ubuntu cloud-init: 256 SHA256:GbiqHwMBtH5lqPV2feHmioYLebVDmzs1cR9o+aD13Gs root@ubuntu (ED25519)
Feb 12 15:12:06 ubuntu cloud-init: 2048 SHA256:iXk1lobwN2tAhEIakffr3nzjokapoZ+Mt0dFgfsP4Os root@ubuntu (RSA)
Feb 12 15:12:06 ubuntu cloud-init: -----END SSH HOST KEY FINGERPRINTS-----
Feb 12 15:12:06 ubuntu cloud-init: #############################################################
Feb 12 15:12:06 ubuntu systemd-timesyncd[555]: Synchronized to time server 185.125.190.56:123 (ntp.ubuntu.com).
Feb 12 15:12:07 ubuntu cloud-init[1133]: Cloud-init v. 22.4.2-0ubuntu0~18.04.1 running 'modules:final' at Sun, 12 Feb 2023 15:12:06 +0000. Up 64.11 seconds.
Feb 12 15:12:07 ubuntu cloud-init[1133]: Cloud-init v. 22.4.2-0ubuntu0~18.04.1 finished at Sun, 12 Feb 2023 15:12:07 +0000. Datasource DataSourceOpenStackLocal [net
Feb 12 15:51:39 ubuntutest cloud-init[940]: chpasswd.list: DEPRECATED: List of ``username:password`` pairs. Each user will have the corresponding password set. A password can be randomly generated by specifying ``RANDOM`` or ``R`` as a user's password. A hashed password, created by a tool like ``mkpasswd``, can be specified. A regex (``r'\$(1|2a|2y|5|6)(\$.+){2}'``) is used to determine if a password value should be treated as a hash.
Active: active (running) since Sun 2023-02-12 23:52:36 CST; 21min ago
Main PID: 2536 (apache2)
Tasks: 55 (limit: 1151)
CGroup: /system.slice/apache2.service
├─2536 /usr/sbin/apache2 -k start
├─2563 /usr/sbin/apache2 -k start
└─2564 /usr/sbin/apache2 -k start
Feb 12 23:52:36 ubuntutest systemd[1]: Starting The Apache HTTP Server...
Feb 12 23:52:36 ubuntutest apachectl[2515]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.16.1.15. Set the 'Serv
Feb 12 23:52:36 ubuntutest systemd[1]: Started The Apache HTTP Server.