-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46620c8
commit 79f8d8f
Showing
3 changed files
with
34 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# basic PAM configuration for rdpgw on Alpine | ||
auth include base-auth | ||
auth include base-account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,34 @@ | ||
#!/bin/sh | ||
|
||
USER=rdpgw | ||
|
||
file="/root/createusers.txt" | ||
if [ -f $file ] | ||
then | ||
while IFS=: read -r username password is_sudo | ||
do | ||
echo "Username: $username, Password: **** , Sudo: $is_sudo" | ||
|
||
if getent passwd "$username" > /dev/null 2>&1 | ||
then | ||
echo "User Exists" | ||
else | ||
adduser -s /sbin/nologin "$username" | ||
echo "$username:$password" | chpasswd | ||
fi | ||
done <"$file" | ||
fi | ||
|
||
cd /opt/rdpgw || exit 1 | ||
|
||
if ! [ -e /opt/rdpgw/rdpgw.yaml ]; then | ||
cp /opt/rdpgw/rdpgw.yaml.default /opt/rdpgw/rdpgw.yaml | ||
if [ -n "${RDPGW_SERVER__AUTHENTICATION}" ]; then | ||
if [ "${RDPGW_SERVER__AUTHENTICATION}" = "local" ]; then | ||
echo "Starting rdpgw-auth" | ||
/opt/rdpgw/rdpgw-auth & | ||
fi | ||
fi | ||
|
||
/opt/rdpgw/rdpgw-auth & | ||
/opt/rdpgw/rdpgw & | ||
# drop privileges and run the application | ||
su -c /opt/rdpgw/rdpgw ${USER} & | ||
wait | ||
exit $? |