mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-16 06:05:33 +08:00
70 lines
1.9 KiB
INI
70 lines
1.9 KiB
INI
# 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
|
|
|
|
# configure localization
|
|
locale: en_US.UTF-8
|
|
|
|
# configure 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: 2
|
|
ethernets:
|
|
eth0:
|
|
dhcp4: false
|
|
addresses: [IPv4/ipPrefix]
|
|
routes:
|
|
- to: default
|
|
via: GATE
|
|
nameservers:
|
|
addresses: [ipDNS1, ipDNS2]
|
|
|
|
# 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
|
|
- sed -i 's/#$nrconf{restart} = '"'"'i'"'"';/$nrconf{restart} = '"'"'a'"'"';/g' /etc/needrestart/needrestart.conf
|
|
- apt update
|
|
- apt install dnsutils fail2ban file lrzsz net-tools traceroute unzip vim wget xz-utils -y
|
|
- sed -ri 's/set compatible/set nocompatible/g' /etc/vim/vimrc.tiny
|
|
- sed -ri '/set nocompatible/a\set backspace=2' /etc/vim/vimrc.tiny
|
|
- mv /etc/netplan/50-cloud-init.yaml /etc/netplan/20-netcfg.yaml
|
|
- netplan apply
|
|
- rm -rf /etc/cloud/cloud.cfg.d/99-fake_cloud.cfg
|
|
- touch /etc/cloud/cloud-init.disabled
|
|
|
|
# configure cloud-init for NoCloud
|
|
datasource_list: [ NoCloud, None ]
|