Tools/Linux_reinstall/Ubuntu/CloudInit/99-fake_cloud.cfg

59 lines
1.4 KiB
INI
Raw Normal View History

2023-06-07 21:09:32 +08:00
# CLOUD_IMG: This file was created/modified by the Cloud Image build process
# configure repository
system_info:
package_mirrors:
- arches: [i386, amd64]
failsafe:
primary: http://archive.ubuntu.com/ubuntu
security: http://security.ubuntu.com/ubuntu
- arches: [armhf, armel, default]
failsafe:
primary: http://ports.ubuntu.com/ubuntu-ports
security: http://ports.ubuntu.com/ubuntu-ports
# configure hostname
2023-06-08 02:23:22 +08:00
hostname: HostName
2023-06-07 21:09:32 +08:00
2023-06-08 02:29:28 +08:00
# timezone
timezone: TimeZone
2023-06-07 21:09:32 +08:00
# configure root user
users:
- name: root
lock_passwd: false
shell: /bin/bash
chpasswd:
expire: false
list: |
2023-06-08 02:42:29 +08:00
root:tmpWORD
2023-06-07 21:09:32 +08:00
users:
- name: root
2023-06-08 02:23:22 +08:00
password: tmpWORD
2023-06-07 21:09:32 +08:00
type: text
# configure network
network:
version: 1
config:
- type: physical
name: eth0
subnets:
- type: dhcp
- type: dhcp6
# later commands
runcmd:
2023-06-08 02:23:22 +08:00
- sed -ri 's/^#?Port.*/Port sshPORT/g' /etc/ssh/sshd_config
2023-06-07 21:09:32 +08:00
- sed -ri 's/^#?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
- sed -ri 's/^#?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
- update-rc.d ssh enable
- /etc/init.d/ssh restart
- apt update
- apt install curl dnsutils efibootmgr fail2ban figlet file lrzsz jq lsof lsb-release net-tools python3 subnetcalc telnet traceroute unzip vim wget xz-utils -y
2023-06-08 00:18:43 +08:00
- rm -rf /etc/cloud/cloud.cfg.d/99-fake_cloud.cfg
2023-06-07 21:09:32 +08:00
# configure cloud-init for NoCloud
datasource_list: [ NoCloud, None ]