From d0c4ef6160633559f164c699319500cd3db27786 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Tue, 17 Jan 2023 07:27:30 -0500 Subject: [PATCH] Specify /bin/bash as the tinypilot user's shell (#1261) Without a shell specified, the user defaults to /usr/sbin/nologin, which prevents us from executing commands as the tinypilot user through sudo su. I tested this on a clean install of Raspbian Buster Lite, and it fixes the `sudo su` issue. Fixes #1260 Review
on CodeApprove --- debian-pkg/debian/tinypilot.postinst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian-pkg/debian/tinypilot.postinst b/debian-pkg/debian/tinypilot.postinst index 4c0161065..e6964f990 100755 --- a/debian-pkg/debian/tinypilot.postinst +++ b/debian-pkg/debian/tinypilot.postinst @@ -21,6 +21,9 @@ getent group "${TINYPILOT_GROUP}" > /dev/null || \ # adduser is idempotent, so we don't need to check existence first. adduser \ --system \ + `# We have to specify a shell to override the default /usr/sbin/nologin, ` \ + `# which prevents us from executing commands through "sudo su".` \ + --shell /bin/bash \ --ingroup "${TINYPILOT_GROUP}" \ --home "${TINYPILOT_HOME_DIR}" \ "${TINYPILOT_USER}"