postinstall shoud give suggestion about sudo install
lucamosca1 opened this issue · 1 comments
Standard Debian installation comes without sudo installed. While running postinstall as root the message is: don't run as root
A suggestion should follow about how to install and configure sudo, such as
apt install sudo
usermod -aG sudo username
sudo not being installed isn't an issue I've seen before. A cursory search turned up this very old question suggesting that it is due to enabling the root password in the installer UI. I would always leave it blank to lock the account.
However, when I install Debian from the standard live image and provide a root password, sudo still gets installed. I also mounted the live ISO image itself, looked at the package manifest (dists/buster/main/debian-installer/binary-amd64/Packages), and found sudo to be absent...
I'll set aside the question of why sudo would be missing for now.
I added a check that runs at the start of the postinstall script. If sudo isn't installed, it installs it via su
(assumes that root login in enabled), and if the user isn't in sudo (and not root), it adds it.