mirror of
https://github.com/bohanyang/debi.git
synced 2026-09-27 06:26:15 +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`
|
* `--skip-account-setup`
|
||||||
* `--username debian` New user with `sudo` privilege or `root`
|
* `--username debian` New user with `sudo` privilege or `root`
|
||||||
* `--password <string>` New user password to set. **Will be prompted if not specified here**
|
* `--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
|
* `--timezone UTC` https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
|
||||||
* `--ntp 0.debian.pool.ntp.org`
|
* `--ntp 0.debian.pool.ntp.org`
|
||||||
* `--skip-partitioning`
|
* `--skip-partitioning`
|
||||||
* `--disk <string>` Manually select a boot disk when more than one disk is available. e.g. `/dev/sda`
|
* `--disk <string>` Manually select a disk for installation. **Please remember to specify this when more than one disk is available!** e.g. `/dev/sda`
|
||||||
* `--force-gpt` Create a *GUID Partition Table* **(Default)**
|
* `--no-force-gpt` By default, GPT rather than MBR partition table will be created. This option disables it.
|
||||||
* `--no-force-gpt`
|
|
||||||
* `--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)
|
* `--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
|
* `--efi` Create an *EFI system partition*. Default if `/sys/firmware/efi` exists
|
||||||
* `--filesystem ext4`
|
* `--filesystem ext4`
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ security_repository=http://security.debian.org/debian-security
|
|||||||
skip_account_setup=false
|
skip_account_setup=false
|
||||||
username=debian
|
username=debian
|
||||||
password=
|
password=
|
||||||
sudo_no_password=false
|
sudo_password=false
|
||||||
cleartext_password=false
|
cleartext_password=false
|
||||||
timezone=UTC
|
timezone=UTC
|
||||||
ntp=0.debian.pool.ntp.org
|
ntp=0.debian.pool.ntp.org
|
||||||
@@ -148,8 +148,8 @@ while [ $# -gt 0 ]; do
|
|||||||
password=$2
|
password=$2
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--sudo-no-password)
|
--sudo-password)
|
||||||
sudo_no_password=true
|
sudo_password=true
|
||||||
;;
|
;;
|
||||||
--timezone)
|
--timezone)
|
||||||
timezone=$2
|
timezone=$2
|
||||||
@@ -166,9 +166,6 @@ while [ $# -gt 0 ]; do
|
|||||||
disk=$2
|
disk=$2
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--force-gpt)
|
|
||||||
force_gpt=true
|
|
||||||
;;
|
|
||||||
--no-force-gpt)
|
--no-force-gpt)
|
||||||
force_gpt=false
|
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"
|
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
|
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\""
|
run_later "echo \"$username ALL=(ALL:ALL) NOPASSWD:ALL\" > \"/etc/sudoers.d/90-user-$username\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user