Skip to content

Commit

Permalink
removed user 'pi' completely
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrsr committed Mar 25, 2024
1 parent f515191 commit 0f9150b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 32 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
- name: Check for Tag
id: check
run: |
git fetch --tags
if [[ ! -z "$(git tag --contains HEAD)" ]]; then
echo "publish=true" >> $GITHUB_OUTPUT
fi
Expand All @@ -94,7 +95,9 @@ jobs:
uses: actions/checkout@v4

- name: Set tag variable
run: echo "TAG=${git tag --contains HEAD}" >> $GITHUB_ENV
run: |
git fetch --tags
echo "TAG=$(git tag --contains HEAD)" >> $GITHUB_ENV
- name: Cache register
id: cache
Expand Down
10 changes: 6 additions & 4 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ RUN touch /mnt/boot/ssh
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /mnt/root/etc/ssh/sshd_config \
&& sed -i 's/#PermitEmptyPasswords no/permitEmptyPasswords yes/' /mnt/root/etc/ssh/sshd_config

# Set user configuration
COPY src/conf/shadow /mnt/root/etc/
# Remove default user home
RUN rm -r /mnt/root/home/pi
# Enable root login and remove user 'pi'
RUN sed -i 's/^root:\*:/root::/' /mnt/root/etc/shadow \
&& sed -i '/^pi/d' /mnt/root/etc/shadow \
&& sed -i '/^pi/d' /mnt/root/etc/passwd \
&& sed -i '/^pi/d' /mnt/root/etc/group \
&& rm -r /mnt/root/home/pi

# Setup root auto login
RUN mkdir /mnt/root/etc/systemd/system/[email protected]/
Expand Down
27 changes: 0 additions & 27 deletions src/conf/shadow

This file was deleted.

0 comments on commit 0f9150b

Please sign in to comment.