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/*,结果以并集论。 源列表文件以行为单位,每行分多个字段,字段间以空白符分隔。井号(#)开头为注释行。
4134 0
|
4月前
|
Ubuntu Linux 索引
Centos 7、Debian及Ubuntu系统中安装和验证tree命令的指南。
通过上述步骤,我们可以在CentOS 7、Debian和Ubuntu系统中安装并验证 `tree`命令。在命令行界面中执行安装命令,然后通过版本检查确认安装成功。这保证了在多个平台上 `tree`命令的一致性和可用性,使得用户无论在哪种Linux发行版上都能使用此工具浏览目录结构。
388 78
|
2月前
|
Ubuntu 关系型数据库 MySQL
MySQL包安装 -- Debian系列(离线DEB包安装MySQL)
本文详细介绍了在Ubuntu 24.04、22.04、20.04及Debian 12系统上,通过离线DEB包安装MySQL 8.0和8.4版本的完整步骤。涵盖下载地址、依赖处理、dpkg安装顺序、配置方法及服务启动验证,确保用户可顺利部署MySQL数据库。
735 0
MySQL包安装 -- Debian系列(离线DEB包安装MySQL)
|
2月前
|
运维 Ubuntu 关系型数据库
MySQL包安装 -- Debian系列(Apt资源库安装MySQL)
本文介绍了在Debian系列系统(如Ubuntu、Debian 11/12)中通过APT仓库安装MySQL 8.0和8.4版本的完整步骤,涵盖添加官方源、配置国内镜像、安装服务及初始化设置,并验证运行状态,适用于各类Linux运维场景。
636 0
MySQL包安装 -- Debian系列(Apt资源库安装MySQL)
|
6月前
|
Ubuntu Linux Shell
Linux环境下VSCode快速安装终极指南:debian/ubuntu/linux平台通用
以上就是在Linux环境下安装VSCode的终极指南,抛开繁复的专业词汇,以平易近人的文字、形象生动的比喻让你轻松学会这一过程。别忘了,你的小伙伴VSCode已经在应用菜单里等你了!
1532 23
|
6月前
|
安全 应用服务中间件 Linux
Debian操作系统如何安装Nginx并开启HTTP2
本指南介绍了在Linux系统中通过源码编译安装Nginx的完整流程。首先更新软件包列表并安装必要的编译依赖,接着下载指定版本的Nginx源码包(如1.24.0),检查文件完整性后解压。随后通过配置脚本指定安装路径与模块(如HTTP SSL模块),执行编译和安装命令。最后创建软链接以便全局调用,并提供启动、停止及重载Nginx的命令,同时提醒注意安全组设置以确保正常访问。
|
9月前
|
Ubuntu 安全 调度
在Ubuntu下安装Debian包:dpkg与apt命令的深度解构。
安装Debian包的知识,就像掌握了海上的航行技术,虽然起初会让人感到陌生甚至困惑,但只要你积累熟练,就能在Ubuntu的世界里畅游无阻。就像每一位成功的航海家,掌握好这些工具,去探索属于你的Ubuntu新世界吧!
317 21
|
8月前
|
Ubuntu Linux
Ubuntu中dpkg和apt命令:debian包安装详解
希望这让你对于Ubuntu中的dpkg和apt命令有了更为清晰的理解。下次你面对软件包安装的问题,就可以轻松应对,优雅地在你的Linux系统中游刃有余了。
774 10
|
9月前
|
安全 网络安全 数据库
Debian12系统如何安装宝塔面板?
宝塔面板是一款便捷的服务器管理工具,界面直观易用,适合各技术水平用户。它支持网站部署、数据库管理,并提供安全防护功能。安装步骤简单:注册账号、连接服务器、运行脚本即可。确保系统满足最低要求(内存≥1GB,硬盘≥10GB),安装后通过浏览器登录管理。根据需求安装套件,完成网站配置。注意放行防火墙端口以保证正常访问。
579 0