From c2cfdd68b46a49cdfa8e092ba57926f7157c6306 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Sat, 9 Jan 2021 05:29:28 +0000 Subject: [PATCH] sudo no password by default; remove force gpt option --- README.md | 7 +++---- debi.sh | 11 ++++------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a00c2a4..a0473b8 100644 --- a/README.md +++ b/README.md @@ -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 ` 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 ` 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 ` 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` diff --git a/debi.sh b/debi.sh index 8ac310e..22ff777 100755 --- a/debi.sh +++ b/debi.sh @@ -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