fedora cloud image设置密码方法

上网下了个fedora cloud image的qcow2文件,起来虚机后没法登陆,也没有默认密码,后来发现是给云服务用的,要用cloud-init来初始化密码,本机上可以建个iso来初始化

1. Create a file called "meta-data" with the contents

instance-id: iid-local01;
local-hostname: fed21;

2. Create a file called "user-data" with

#cloud-config
password: fedora
chpasswd: { expire: False }
ssh_pwauth: True

3. Make a cdrom image:

genisoimage -output init.iso -volid cidata -joliet -rock user-data meta-data

4. Boot the image:

qemu-system-x86_86 -cdrom init.iso Fedora-Cloud-Base.qcow2

5. At the command prompt, you can log in with username fedora and password fedora (see above).

参考:https://www.linkedin.com/pulse/20141028154147-1457754-how-to-log-into-fedora-cloud-images

posted on 2024-03-24 14:30  ww2000e  阅读(83)  评论(0编辑  收藏  举报