Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libre
docker-sshd
Commits
114bebfe
Commit
114bebfe
authored
Jun 21, 2022
by
Michał Woźniak
Browse files
Update run.sh: SSH_PASSWORD implemented
parent
e61190d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
run.sh
View file @
114bebfe
...
...
@@ -223,8 +223,17 @@ else
# we either have no UID given (and don't care about it), or have a UID given that does not exist in the system
# great! let's add the user
useradd
$UID_ARGS
-r
-g
"
$SSH_GROUP
"
-s
/bin/bash
"
$SSH_USER
"
# by default disable the password
passwd
-d
"
$SSH_USER
"
# do we have a password set for the user?
if
[[
"
$SSH_PASSWORD
"
==
""
]]
;
then
echo
" +-- disabling '
$SSH_USER
' user password"
# by default disable the password
passwd
-d
"
$SSH_USER
"
else
echo
" +-- setting '
$SSH_USER
' user password to the one provided in SSH_PASSWORD"
echo
"
$SSH_USER
:
$SSH_PASSWORD
"
| chpasswd
fi
# create home
mkdir
-p
"/home/
$SSH_USER
"
# and make sure that permissions and ownership are set properly
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment