Add ability to encrypt first user

This commit is contained in:
Fierelier 2022-06-08 12:09:57 +02:00
parent 551bd223dd
commit 248972ad83
2 changed files with 9 additions and 2 deletions

View File

@ -82,11 +82,18 @@ ff02::2 ip6-allrouters\
while True: while True:
username = input("First user (Administrator): ").lower().strip(" ") username = input("First user (Administrator): ").lower().strip(" ")
if username == "root": continue if username == "root": continue
print("Encrypt user? Recommended for machines that may be stolen or spying relatives. (y/n)")
encrypt = mchoice(["y","n"])
ucommand = ["adduser"]
if encrypt == "y": ucommand.append("--encrypt-home")
ucommand = ucommand + ["--gecos","",username]
try: try:
call(["id","-u",username]) call(["id","-u",username])
except: except:
try: try:
call(["adduser",username]) call(ucommand)
except: except:
try: try:
call(["deluser","--remove-home",username]) call(["deluser","--remove-home",username])

View File

@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
export OPUS_PACKAGES="$OPUS_PACKAGES sudo keyboard-configuration network-manager python3" export OPUS_PACKAGES="$OPUS_PACKAGES sudo keyboard-configuration network-manager python3 ecryptfs-utils"
export OPUS_PACKAGES_DL="$OPUS_PACKAGES console-setup locales tzdata" export OPUS_PACKAGES_DL="$OPUS_PACKAGES console-setup locales tzdata"