Skip to content

Commit

Permalink
Specify /bin/bash as the tinypilot user's shell (#1261)
Browse files Browse the repository at this point in the history
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

<a data-ca-tag
href="https://codeapprove.com/pr/tiny-pilot/tinypilot/1261"><img
src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review
on CodeApprove" /></a>
  • Loading branch information
mtlynch authored Jan 17, 2023
1 parent f902ccb commit d0c4ef6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions debian-pkg/debian/tinypilot.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit d0c4ef6

Please sign in to comment.