Skip to content

Commit 22b44ea

Browse files
authored
Update start-nb-with-ssh-dev.sh
1 parent 8f013b4 commit 22b44ea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

start-nb-with-ssh-dev.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
set -e
55

66
if [ -n "$JUPYTER_TOKEN" ]; then
7-
echo "jovyan:$JUPYTER_TOKEN" | sudo chpasswd
7+
echo -e "password\n$JUPYTER_TOKEN\n$JUPYTER_TOKEN" | passwd jovyan
8+
else
9+
RANDOM_PASSWORD=$(openssl rand -base64 32)
10+
echo -e "password\n$RANDOM_PASSWORD\n$RANDOM_PASSWORD" | passwd jovyan
11+
echo "user password: $RANDOM_PASSWORD" > /home/jovyan/password.txt
12+
chmod 600 /home/jovyan/password.txt
13+
echo "Password saved to /home/jovyan/password.txt"
814
fi
915

1016
sudo /usr/sbin/sshd -D &

0 commit comments

Comments
 (0)