Skip to content

Commit

Permalink
feat: bluefin-cli enable sudo/chown linuxbrew (ublue-os#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles authored Dec 31, 2023
1 parent 25b12e3 commit cc6b6b4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions toolboxes/Containerfile.bluefin-cli
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ RUN grep -v '^#' /toolbox-packages | xargs apk add

RUN rm /toolbox-packages

# Make Sudo Work (Assumes UID = 1000)
COPY ./toolboxes/files.bluefin-cli/etc/sudoers /etc/sudoers
COPY ./toolboxes/files.bluefin-cli/etc/pam.d /etc/pam.d

# Have Linuxbrew owned by UID = 1000
RUN chown -R 1000 /home/linuxbrew/.linuxbrew /home/linuxbrew/.linuxbrew/bin

# Change root shell to BASH

RUN sed -i -e '/^root/s/\/bin\/ash/\/bin\/bash/' /etc/passwd
7 changes: 7 additions & 0 deletions toolboxes/files.bluefin-cli/etc/pam.d/sudo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#%PAM-1.0

auth required pam_env.so
auth sufficient pam_unix.so
account required pam_unix.so
session required pam_limits.so
session required pam_unix.so
7 changes: 7 additions & 0 deletions toolboxes/files.bluefin-cli/etc/pam.d/sudo-i
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#%PAM-1.0

auth required pam_env.so
auth sufficient pam_unix.so
account required pam_unix.so
session required pam_limits.so
session required pam_unix.so
3 changes: 3 additions & 0 deletions toolboxes/files.bluefin-cli/etc/sudoers
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
root ALL = (ALL:ALL) NOPASSWD:ALL
# Make UID 1000 able to use sudo without a password
#1000 ALL = (root) NOPASSWD:ALL

0 comments on commit cc6b6b4

Please sign in to comment.