mirror of
https://github.com/leitbogioro/Tools.git
synced 2025-10-06 13:25:55 +08:00
Create 99-fake_cloud.cfg
This commit is contained in:
parent
66b5a7b75c
commit
5ae4ea4172
1 changed files with 54 additions and 0 deletions
54
Linux_reinstall/Ubuntu/CloudInit/99-fake_cloud.cfg
Normal file
54
Linux_reinstall/Ubuntu/CloudInit/99-fake_cloud.cfg
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
# 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
|
||||||
|
hostname: myhost
|
||||||
|
|
||||||
|
# configure root user
|
||||||
|
users:
|
||||||
|
- name: root
|
||||||
|
lock_passwd: false
|
||||||
|
shell: /bin/bash
|
||||||
|
|
||||||
|
chpasswd:
|
||||||
|
expire: false
|
||||||
|
list: |
|
||||||
|
root:LeitboGi0ro
|
||||||
|
users:
|
||||||
|
- name: root
|
||||||
|
password: LeitboGi0ro
|
||||||
|
type: text
|
||||||
|
|
||||||
|
# configure network
|
||||||
|
network:
|
||||||
|
version: 1
|
||||||
|
config:
|
||||||
|
- type: physical
|
||||||
|
name: eth0
|
||||||
|
subnets:
|
||||||
|
- type: dhcp
|
||||||
|
- type: dhcp6
|
||||||
|
|
||||||
|
# later commands
|
||||||
|
runcmd:
|
||||||
|
- sed -ri 's/^#?Port.*/Port 22/g' /etc/ssh/sshd_config
|
||||||
|
- 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
|
||||||
|
|
||||||
|
# configure cloud-init for NoCloud
|
||||||
|
datasource_list: [ NoCloud, None ]
|
Loading…
Add table
Reference in a new issue