In all its glory! For Debian 10 and up, because Debian 10 is where the sysv to systemd conversion became totalizing.
Let’s break down quickly why each part of this is needed:
- Since we are trying to add ourselves to the
sudogroup right now, we obviously can’t usesudo. Entersu -cto switch toroot, run a command, and then switch back out. whereis adduserinstead of simplyadduserbecauseadduseris no longer in the$PATHby default anymore.- Tempted to try
which adduser? No dice –whichonly gets you things in the$PATHas well:
- Tempted to try
awkto rip out/usr/sbin/adduser, which - thankfully - at least is still executable.$(whoami)because your name might not beandrew!whereis rebootbecause I don’t want to have to manually remember to logout and login again.