refactor(mkrootfs): use sha512crypt instead of crypt(old)

I misunderstood the meaning of Perl's crypt function,
I thought the second argument was a hash method, but
it was actually salt. using crypt gives the result of
a traditional Unix password hash function, which is
very insecure. Arch Linux currently uses sha512crypt
by default, and we use it as well.

Signed-off-by: Coelacanthus <CoelacanthusHex@gmail.com>
This commit is contained in:
Coelacanthus 2022-08-30 18:09:12 +08:00
parent b4bc366b43
commit 55d5af7f33
No known key found for this signature in database
GPG key ID: E35C89E45867AE35

View file

@ -22,7 +22,7 @@ yes y | sudo pacman \
--sync --clean --clean
msg "Set root password (Default: archriscv)..."
sudo usermod --root $(realpath ./rootfs) --password $(perl -e "print crypt('archriscv','yescrypt')") root
sudo usermod --root $(realpath ./rootfs) --password $(openssl passwd -6 archriscv) root
msg "Compressing rootfs..."
sudo bsdtar --create --zstd --verbose --xattrs --acls -f "archriscv-$(date --rfc-3339=date).tar.zst" -C rootfs/ .