diff --git a/dokku b/dokku index c663b240a..a8f4a3606 100755 --- a/dokku +++ b/dokku @@ -56,8 +56,12 @@ if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]] && [[ ! $1 == "ssh-keys: exit $? fi -if [[ $(id -un) != "root" && $1 =~ ^plugin:.* && $1 != "plugin:help" && $1 != "plugin:list" ]] || [[ $(id -un) != "root" && $1 == "ssh-keys:add" ]]; then - dokku_log_fail "This command must be run as root" +if [[ $1 =~ ^plugin:.* && $1 != "plugin:help" && $1 != "plugin:list" ]] || [[ $1 == "ssh-keys:add" ]]; then + if [[ $(id -un) != "root" ]]; then + dokku_log_fail "This command must be run as root" + else + export SSH_USER=root + fi fi if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then