add ssh-keys/user-auth to prevent non admin access
This commit is contained in:
1 parent
d2854b9e90
commit
c8405ddf34
1 file changed
+11
Executable
+11
@@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
|
check_ssh_keys_user() {
|
||||||
|
declare desc="check user running ssh-keys"
|
||||||
|
local SSH_USER=$1 SSH_NAME=$2
|
||||||
|
[[ "$SSH_USER" != "root" && "$SSH_NAME" != *admin* ]] && dokku_log_fail "You must be root, or a dokku admin, to execute this command" || true
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ "$3" == ssh-keys* ]] && check_ssh_keys_user "$@" || true
|
||||||
Reference in new issue
Block a user