Debian系列的Kickstart模板配置文件

简介:
# 初始设置
d-i     netcfg/choose_interface select em1  # 多网卡初始选择
d-i     debian-installer/locale string en_US.UTF-8 # 选择语言
#d-i     debian-installer/splash boolean false
d-i     console-setup/ask_detect        boolean false
d-i     console-setup/layoutcode        string us # 键盘设置
d-i     console-setup/variantcode       string

# 1. 网络配置
#d-i     netcfg/get_nameservers  string dns服务器
#d-i     netcfg/get_ipaddress    string IP地址
#d-i     netcfg/get_netmask      string 子网掩码
#d-i     netcfg/get_gateway      string 网关
#d-i          netcfg/hostname string somehost 主机名
#d-i     netcfg/confirm_static   boolean true

# 2. 镜像设置
# 根据使用的安装方式,镜像可用于下载安装程序的额外组件、安装基本系统以及为所安装的系统建立 /etc/apt/sources.list
d-i mirror/country string china
d-i mirror/http/hostname string http.mirrors.aliyun.com
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string

# 3. 账号设置
d-i     passwd/root-login       boolean false # 不允许使用root,true为使用root用户
#d-i passwd/root-password password r00tme # root用户的明文密码
#d-i passwd/root-password-again password r00tme # 再次输入
#d-i passwd/root-password-crypted password $6$a.nzemIHmRqyiU$8Ee3.qGy9gPPShhTa/NYyX7c7Ga0kb4UOG.kr1p6tQB7cJRoxdTaXjGcCKHmSWRJ/DI693lJ9Mfy62gJI9L101 # 加密密码可使用mkpasswd -m sha-512来生成加密字符串

d-i     passwd/make-user        boolean true # 使用普通用户
d-i     passwd/user-fullname    string ubuntu # 普通用户的完整名称
d-i     passwd/username string ubuntu # 登录的用户名
d-i     passwd/user-password password ubuntu # 普通用户的密码
d-i     passwd/user-password-again password ubuntu # 再次确认密码
d-i     passwd/user-password-crypted password $6$m4WYoBEE$OFg6PjWwN7r27ri9yfBZXmyhtwbV11Rj0IUYvXFBhdvoIvkIHCNdD3Vltr8H1RHjC.K4Xj5MtXEIRPscTfyxD/ # 加密密码可使用mkpasswd -m sha-512来生成加密字符串

d-i     passwd/user-uid string 501 # 普通用户的uid
d-i     user-setup/allow-password-weak  boolean false
d-i     user-setup/encrypt-home boolean false # 是否对当前用户的家目录进行加密
d-i     passwd/user-default-groups      string adm cdrom dialout lpadmin plugdev sambashare

# 4. 时区设置
d-i     clock-setup/utc boolean true # 设置硬件时钟为UTC
d-i         time/zone string Asia/ShangHai # 设置地区
d-i     clock-setup/ntp boolean true #在NTP安装期间设置时钟
#d-i         clock-setup/ntp-server string ntp.example.com # 设置NTP服务器


# 5. 分区设置

d-i     partman-auto/method string regular # 使用整块硬盘
# 可使用选项如下:
# - regular: 使用整块硬盘
# - lvm:     使用LVM
# - crypto:  使用LVM并且加密分区

d-i     partman-lvm/device_remove_lvm boolean true
d-i     partman-lvm/confirm boolean true
d-i     partman/confirm_write_new_label boolean true
d-i         partman-auto/choose_recipe select atomic # 设置分区
# - atomic: 所有文件在一个分区
# - home:   独立home分区
# - multi:  独立 /home, /usr, /var, and /tmp 分区

d-i     partman/choose_partition        select Finish partitioning and write changes to disk
d-i     partman/confirm boolean true
d-i     partman/confirm_nooverwrite boolean true
d-i     partman/default_filesystem string ext4 # 设置文件系统类型

# 5.1 分区挂载控制
d-i partman/mount_style select uuid #使用UUID方式挂载分区

# 6. 基本系统安装
d-i     base-installer/kernel/image     string linux-server

# 7. 设置apt
d-i     apt-setup/services-select       multiselect security
d-i     apt-setup/security_host string mirrors.163.com # 选择更新的服务器
d-i     apt-setup/security_path string /ubuntu
d-i     debian-installer/allow_unauthenticated  string false
d-i     pkgsel/upgrade  select safe-upgrade
d-i     pkgsel/language-packs   multiselect
d-i     pkgsel/update-policy    select none
d-i     pkgsel/updatedb boolean trueb

# 8. 设置grub以及bootloader
d-i     grub-installer/skip     boolean false
d-i     lilo-installer/skip     boolean false
d-i     grub-installer/only_debian      boolean true
d-i     grub-installer/with_other_os    boolean true

# 9. 安装软件
d-i     pkgsel/include string openssh-server zabbix-agent vim


# 10. 安装过程中运行命令及脚本
#d-i preseed/early_command string anna-install some-udeb
#d-i partman/early_command \
#       string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh

d-i preseed/run string 1.sh

# 完成安装
d-i     finish-install/keep-consoles    boolean false
d-i     finish-install/reboot_in_progress       note
d-i     cdrom-detect/eject      boolean true
d-i     debian-installer/exit/halt      boolean false
d-i     debian-installer/exit/poweroff  boolean false



本文转自 吃草的青蛙 51CTO博客,原文链接:http://blog.51cto.com/tlinux/1749749,如需转载请自行联系原作者
相关文章
|
Ubuntu 安全 Linux
Debian、Ubuntu安装源配置文件说明
源列表主文件 /etc/apt/sources.list,兼取 /etc/apt/sources.list.d/*,结果以并集论。 源列表文件以行为单位,每行分多个字段,字段间以空白符分隔。井号(#)开头为注释行。
3815 0
|
3月前
|
消息中间件 Kubernetes NoSQL
Debian11系统boost库安装
Debian11系统boost库安装
|
5月前
|
Docker 容器
Ubuntu22 debian 安装docker
Ubuntu22 debian 安装docker
118 0
|
5月前
|
Shell 网络安全 数据安全/隐私保护
debian安装ssh(傻瓜教程)+证书免密登录
debian安装ssh(傻瓜教程)+证书免密登录
361 0
|
8月前
|
存储 缓存 安全
Docker Debian安装Docker
Docker Debian安装Docker
1258 0
|
5月前
|
Linux Python
linux 安装 pip2 kali debian python python2
linux 安装 pip2 kali debian python python2
57 0
|
6月前
|
安全 Linux 网络安全
百度搜索:蓝易云 ,Linux Debian11服务器安装SSH,创建新用户并允许SSH远程登录,及SSH安全登录配置!
这些步骤提供了在Debian 11服务器上安装SSH,创建新用户并允许SSH远程登录以及进行SSH安全登录配置的指南。请确保按照步骤操作,并根据您的需求进行必要的修改。
100 0
|
2月前
|
SQL 存储 数据安全/隐私保护
|
7月前
|
Ubuntu Linux
debian/rehhat/linux/centos/ubuntu 安装IDEA
debian/rehhat/linux/centos/ubuntu 安装IDEA
101 0