mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-15 21:54:40 +08:00
Create ipv4_static_interfaces.cfg
This commit is contained in:
parent
1757a6c4ce
commit
472da1ba58
1 changed files with 63 additions and 0 deletions
63
Linux_reinstall/Ubuntu/CloudInit/ipv4_static_interfaces.cfg
Normal file
63
Linux_reinstall/Ubuntu/CloudInit/ipv4_static_interfaces.cfg
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
# 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://targetLinuxMirror/ubuntu
|
||||||
|
security: http://security.ubuntu.com/ubuntu
|
||||||
|
- arches: [armhf, armel, default]
|
||||||
|
failsafe:
|
||||||
|
primary: http://targetLinuxMirror/ubuntu-ports
|
||||||
|
security: http://targetLinuxMirror/ubuntu-ports
|
||||||
|
|
||||||
|
# configure hostname
|
||||||
|
hostname: HostName
|
||||||
|
|
||||||
|
# timezone
|
||||||
|
timezone: TimeZone
|
||||||
|
|
||||||
|
# configure root user
|
||||||
|
users:
|
||||||
|
- name: root
|
||||||
|
lock_passwd: false
|
||||||
|
shell: /bin/bash
|
||||||
|
|
||||||
|
chpasswd:
|
||||||
|
expire: false
|
||||||
|
list: |
|
||||||
|
root:tmpWORD
|
||||||
|
users:
|
||||||
|
- name: root
|
||||||
|
password: tmpWORD
|
||||||
|
type: text
|
||||||
|
|
||||||
|
# configure network
|
||||||
|
network:
|
||||||
|
version: 1
|
||||||
|
config:
|
||||||
|
- type: physical
|
||||||
|
name: eth0
|
||||||
|
subnets:
|
||||||
|
- type: static
|
||||||
|
address: IPv4/ipPrefix
|
||||||
|
gateway: GATE
|
||||||
|
dns_nameservers:
|
||||||
|
- ipDNS1
|
||||||
|
- ipDNS2
|
||||||
|
- type: dhcp6
|
||||||
|
|
||||||
|
# later commands
|
||||||
|
runcmd:
|
||||||
|
- sed -ri 's/^#?Port.*/Port sshPORT/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
|
||||||
|
- rm -rf /etc/cloud/cloud.cfg.d/99-fake_cloud.cfg
|
||||||
|
|
||||||
|
# configure cloud-init for NoCloud
|
||||||
|
datasource_list: [ NoCloud, None ]
|
Loading…
Reference in a new issue