Set SSH_USER for root commands
Previously, SSH_USER was not set for plugin:* or ssh-keys:add, which contradicts the user-auth trigger documentation. Fixes #2700
This commit is contained in:
1 parent
918bc9efe8
commit
73a84f90c5
1 file changed
+6
-2
@@ -56,8 +56,12 @@ if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]] && [[ ! $1 == "ssh-keys:
|
|||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $(id -un) != "root" && $1 =~ ^plugin:.* && $1 != "plugin:help" && $1 != "plugin:list" ]] || [[ $(id -un) != "root" && $1 == "ssh-keys:add" ]]; then
|
if [[ $1 =~ ^plugin:.* && $1 != "plugin:help" && $1 != "plugin:list" ]] || [[ $1 == "ssh-keys:add" ]]; then
|
||||||
dokku_log_fail "This command must be run as root"
|
if [[ $(id -un) != "root" ]]; then
|
||||||
|
dokku_log_fail "This command must be run as root"
|
||||||
|
else
|
||||||
|
export SSH_USER=root
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
|
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
|
||||||
|
|||||||
Reference in new issue
Block a user