mirror of
https://github.com/bohanyang/debi.git
synced 2026-09-26 22:16:11 +00:00
sudo no password by default; remove force gpt option
This commit is contained in:
@@ -48,13 +48,12 @@ This script is written to reinstall a VPS/virtual machine to Debian 10 Buster.
|
||||
* `--skip-account-setup`
|
||||
* `--username debian` New user with `sudo` privilege or `root`
|
||||
* `--password <string>` New user password to set. **Will be prompted if not specified here**
|
||||
* `--sudo-no-password` Make the user run "sudo" commands without entering the password
|
||||
* `--sudo-password` Verify the user's password when running "sudo" commands
|
||||
* `--timezone UTC` https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
|
||||
* `--ntp 0.debian.pool.ntp.org`
|
||||
* `--skip-partitioning`
|
||||
* `--disk <string>` Manually select a boot disk when more than one disk is available. e.g. `/dev/sda`
|
||||
* `--force-gpt` Create a *GUID Partition Table* **(Default)**
|
||||
* `--no-force-gpt`
|
||||
* `--disk <string>` Manually select a disk for installation. **Please remember to specify this when more than one disk is available!** e.g. `/dev/sda`
|
||||
* `--no-force-gpt` By default, GPT rather than MBR partition table will be created. This option disables it.
|
||||
* `--bios` Don't create *EFI system partition*. If GPT is being used, create a *BIOS boot partition* (`bios_grub` partition). Default if `/sys/firmware/efi` is absent. [See](https://askubuntu.com/a/501360)
|
||||
* `--efi` Create an *EFI system partition*. Default if `/sys/firmware/efi` exists
|
||||
* `--filesystem ext4`
|
||||
|
||||
@@ -43,7 +43,7 @@ security_repository=http://security.debian.org/debian-security
|
||||
skip_account_setup=false
|
||||
username=debian
|
||||
password=
|
||||
sudo_no_password=false
|
||||
sudo_password=false
|
||||
cleartext_password=false
|
||||
timezone=UTC
|
||||
ntp=0.debian.pool.ntp.org
|
||||
@@ -148,8 +148,8 @@ while [ $# -gt 0 ]; do
|
||||
password=$2
|
||||
shift
|
||||
;;
|
||||
--sudo-no-password)
|
||||
sudo_no_password=true
|
||||
--sudo-password)
|
||||
sudo_password=true
|
||||
;;
|
||||
--timezone)
|
||||
timezone=$2
|
||||
@@ -166,9 +166,6 @@ while [ $# -gt 0 ]; do
|
||||
disk=$2
|
||||
shift
|
||||
;;
|
||||
--force-gpt)
|
||||
force_gpt=true
|
||||
;;
|
||||
--no-force-gpt)
|
||||
force_gpt=false
|
||||
;;
|
||||
@@ -377,7 +374,7 @@ EOF
|
||||
run_later "sudo -u $username mkdir -m 0700 -p ~$username/.ssh && busybox wget -O - \"$authorized_keys_url\" | sudo -u $username tee -a ~$username/.ssh/authorized_keys"
|
||||
fi
|
||||
|
||||
if [ "$sudo_no_password" = true ]; then
|
||||
if [ "$sudo_password" = false ]; then
|
||||
run_later "echo \"$username ALL=(ALL:ALL) NOPASSWD:ALL\" > \"/etc/sudoers.d/90-user-$username\""
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user