mirror of https://github.com/bohanyang/debi
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
7 years ago | |
|---|---|---|
| LICENSE | 7 years ago | |
| README.md | 7 years ago | |
| netboot.sh | 7 years ago | |
README.md
Setup Clean Debian OS for Your (Cloud) VPS
Step 1. Preparation
- A clean normally running true virtualization (e.g. KVM) VPS with GRUB 2 and VNC access. This script have been tested on SolusVM KVM VPS & Alibaba Cloud ECS with Debian 9 & Ubuntu 16.04.
- Then check
/etc/default/grubwith your preferred editor (e.g.nanoorvi). - Set
GRUB_DEFAULTtodebian-netboot-installerselect the installer to boot automatically after timeout. - Make sure there's reasonable number for
GRUB_TIMEOUTtimeout. You can just setGRUB_TIMEOUT=10which will be fine. - Make sure there's no
GRUB_HIDDEN_TIMEOUT_QUIETandGRUB_HIDDEN_TIMEOUT. Just delete them.
Install dependencies:
sudo apt update && sudo apt -y install ca-certificates whois
Step 2. Run the Script
Replace following <OPTIONS> with your options.
sudo sh -c "$(wget -qO- https://github.com/brentybh/debian-netboot/raw/master/netboot.sh)" -- <OPTIONS>
Remember to enter your current user's password for sudo (if need) and then enter the new user's password (if not specified by --password).
All Options
--template foobarSelected template (see below)--hostname debianHostname. Precedence: provided value > reverse DNS record > the default valuedebian--protocol httpTransport protocol to use with the repository mirror (not for the security mirror). Possible values:http,https,ftp, etc.--mirror deb.debian.orgHostname of the repository mirror (not for the security mirror)--directory /debianDirectory of the repository mirror--suite stretchSelected suite to install (stable,testing,stretch, etc.)--username debianUsername of the administrator account with sudo privilege--password secretPassword of the account (if not specified, it will be asked interactively)--timezone UTCTime zone--ntp-server pool.ntp.orgNTP server--upgrade full-upgradeWhether to upgrade packages after debootstrap (none,safe-upgrade,full-upgrade)--security-mirror http://security.debian.org/debian-securitySpecify a URL for the security mirror or set totrueto use the same mirror as the repository mirror instead of the default one--filesystem ext4Filesystem for partition--disk-encryptionEnable full disk encryption. Since it can't be fully automated currently, you'll need physical console (VNC) access to go through the steps--ip 12.34.56.78Configure network manually with an IP address (the following-cidr,-gwand-dnsoptions only work when an IP address is specified)--netmask 255.255.255.0Netmask for manual network configuration--gateway 12.34.56.1Gateway for manual network configuration--dns "1.1.1.1 1.0.0.1"DNS for manual network configuration--include "ca-certificates curl fail2ban openssl whois"Include additional packages to install--manualManually configure user account and disk partition, etc. Network connection, the repository and security mirrors, time zone and NTP server are already auto-configured--ssh-password installerSecretEnable SSH access to the installer with a password. You can login toinstalleruser and continue installation manually or just check system logs.--ssh-keys https://example.com/.ssh/authorized_keysEnable SSH access to the installer with a URL of the file contains authorized public keys. (see above) You can't access with password if authorized public keys are provided here.--dry-runGeneratepreseed.cfgand save to current directory but don't actually do anything--architecture amd64Specify an architecture (useful under CentOS)--boot-partitionUse/as the boot directory for the GRUB boot entry instead of/boot, useful under LVM machines with an independent boot partition
Templates
You can select a template for quickly applying options. All custom settings will override template values.
china
--protocol https--mirror chinanet.mirrors.ustc.edu.cn--security-mirror true--timezone Asia/Shanghai--ntp-server cn.ntp.org.cn--dns "156.154.70.5 156.154.71.5"
cloud
--protocol https--mirror cdn-aws.deb.debian.org--security-mirror true--ntp-server time.google.com
Step 3. Entering Debian Installer
- Keep your SSH connection and open VNC console on your Provider's control panel.
sudo rebootwith your SSH and the VM should reboot.- Switch to your VNC window quickly. You should enter the GRUB selection menu now.
- If you've configured correct
GRUB_DEFAULT, it should be booted into installer automatically after timeout. - Or, use your keyboard to select
New Installand enter it. Also, be quick, just do not miss theGRUB_TIMEOUTtimeout you've set. - Finally, you should see the screen of Debian Installer now. It will setup all things automatically and reboot when complete.