Skip to content

minikube ssh doesn't escape args properly #20855

@zimbatm

Description

@zimbatm

What Happened?

$ minikube ssh -- bash -c "sudo ls"
usage: sudo -h | -K | -k | -V
usage: sudo -v [-ABknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-ABknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-ABbEHknPS] [-r role] [-t type] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory]
            [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-ABknS] [-r role] [-t type] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory]
            [-T timeout] [-u user] file ...
ssh: Process exited with status 1

This looks like an issue where the arguments with whitespaces don't get escaped properly. Instead of sending bash -c "sudo ls" it looks like it gets translated to bash -c "sudo" "ls".

Attach the log file

log.txt

Operating System

Other

Driver

Docker

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions