-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from dodopizza/sre-remova-scaleft-6419620
#6419620 remove sft, add az ssh, minor updates
- Loading branch information
Showing
5 changed files
with
14 additions
and
70 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
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 |
---|---|---|
@@ -1,37 +1,6 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# For ScaleFT Host machine user mapping | ||
# scaleft user forwarding: | ||
# docker run \ | ||
# -e "SFT_USER_ID=$(id -u)" \ | ||
# -e "SFT_USER_NAME=$(id -un)" \ | ||
# -v /var/run/sftd/management.sock:/var/run/sftd/management.sock | ||
# .. | ||
# | ||
|
||
## Default entrypoint | ||
if [ -z ${SFT_USER_NAME:-''} ]; then | ||
exec "$@" | ||
exit $? | ||
fi | ||
|
||
## For scaleft user forwarding from host machine to container | ||
echo "Preparing local sft user ${SFT_USER_NAME} with id ${SFT_USER_ID}" | ||
useradd -u ${SFT_USER_ID} -g root ${SFT_USER_NAME} \ | ||
&& echo "${SFT_USER_NAME}" | passwd --stdin ${SFT_USER_NAME} \ | ||
&& echo "${SFT_USER_NAME} ALL=NOPASSWD:ALL" | EDITOR='tee -a' visudo \ | ||
|| true | ||
|
||
su -l ${SFT_USER_NAME} -c " | ||
whoami | ||
install -d ~/.ssh/ | ||
sft ssh-config > ~/.ssh/config | ||
sft config service_auth.enable true >/dev/null | ||
" | ||
|
||
if [ $# -gt 0 ]; then | ||
su -l ${SFT_USER_NAME} -c "$@" | ||
else | ||
su -l ${SFT_USER_NAME} | ||
fi | ||
exec "$@" | ||
exit $? |
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