Skip to content

Commit c64027b

Browse files
committed
create non root standard-user with default password password- yes really
1 parent 42bd681 commit c64027b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

create-scratch-space.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ mkdir "$SCRATCH_DIR"
1111
cd $SCRATCH_DIR
1212

1313

14-
mkdir bin dev proc sys etc root usr var
14+
mkdir bin dev proc sys etc root usr var home
1515
mkdir -p usr/bin/libexec # (sshd-session by (default?) compiles into /usr/bin/libexec
1616
mkdir -p etc/ssh
1717
mkdir -p var/run # (otherwise sshd cannot write its pid file)
18+
mkdir -p home/standard-user
1819

19-
# Crate users/groups
20-
21-
echo 'root:x:0:' > ./etc/group
2220

2321
# Copy over busybox
2422
cp "$BUILD_ARTIFACTS_FOLDER"/busybox/busybox ./bin
@@ -45,14 +43,23 @@ done
4543
cd - && cd ../
4644
echo $PWD
4745

46+
# Crate users/groups
47+
4848
# Layout minimal user accounts
4949
echo 'root:x:0:0:root:/root:/bin/sh' > ./etc/passwd
50+
51+
echo 'standard-user:x:1000:1000:standard-user:/home/standard-user:/bin/sh' >> ./etc/passwd
52+
5053
# Without sshd user, you get 'Privilege separation user sshd does not exist'
5154
echo 'sshd:x:128:65534::/run/sshd:/usr/sbin/nologin' >> ./etc/passwd
5255

5356
echo 'root:*:19216:0:99999:7:::' > ./etc/shadow
54-
5557
echo 'echo 'root:x:0:' > ./etc/groups'
58+
59+
echo 'Creating standard-user with default password password'
60+
echo 'standard-user:zyEbcafGgBcEw:20080:1000:99999:7:::' >> ./etc/shadow
61+
echo 'echo 'standard-user:x:1000:' > ./etc/groups'
62+
5663
mkdir var/empty # TODO Missing privilege separation directory: /var/empty (sshd wants it)
5764
# NOTE ownership of /var/empty is altered during init
5865

0 commit comments

Comments
 (0)