github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-machine-ssh.1.md (about) 1 % podman-machine-ssh 1 2 3 ## NAME 4 podman\-machine\-ssh - SSH into a virtual machine 5 6 ## SYNOPSIS 7 **podman machine ssh** [*options*] [*name*] [*command* [*arg* ...]] 8 9 ## DESCRIPTION 10 11 SSH into a Podman-managed virtual machine and optionally execute a command 12 on the virtual machine. Unless using the default virtual machine, the 13 first argument must be the virtual machine name. The optional command to 14 execute can then follow. If no command is provided, an interactive session 15 with the virtual machine is established. 16 17 The exit code from ssh command is forwarded to the podman machine ssh caller, see [Exit Codes](#Exit-Codes). 18 19 The default machine name is `podman-machine-default`. If a machine name is not specified as an argument, 20 then `podman-machine-default` will be SSH'd into. 21 22 Rootless only. 23 24 ## OPTIONS 25 26 #### **--help** 27 28 Print usage statement. 29 30 #### **--username**=*name* 31 32 Username to use when SSH-ing into the VM. 33 34 ## Exit Codes 35 36 The exit code from `podman machine ssh` gives information about why the command failed. 37 When `podman machine ssh` commands exit with a non-zero code, 38 the exit codes follow the `chroot` standard, see below: 39 40 **125** The error is with podman **_itself_** 41 42 $ podman machine ssh --foo; echo $? 43 Error: unknown flag: --foo 44 125 45 46 **126** Executing a _contained command_ and the _command_ cannot be invoked 47 48 $ podman machine ssh /etc; echo $? 49 Error: fork/exec /etc: permission denied 50 126 51 52 **127** Executing a _contained command_ and the _command_ cannot be found 53 54 $ podman machine ssh foo; echo $? 55 Error: fork/exec /usr/bin/bogus: no such file or directory 56 127 57 58 **Exit code** _contained command_ exit code 59 60 $ podman machine ssh /bin/sh -c 'exit 3'; echo $? 61 3 62 63 ## EXAMPLES 64 65 To get an interactive session with the default Podman machine: 66 67 SSH into the default Podman machine. 68 ``` 69 $ podman machine ssh 70 ``` 71 72 Run command inside the default Podman machine via ssh. 73 ``` 74 $ podman machine ssh myvm 75 ``` 76 77 Run command inside the specified Podman machine via ssh. 78 ``` 79 $ podman machine ssh myvm rpm -q podman 80 ``` 81 82 ## SEE ALSO 83 **[podman(1)](podman.1.md)**, **[podman-machine(1)](podman-machine.1.md)** 84 85 ## HISTORY 86 March 2021, Originally compiled by Ashley Cui <acui@redhat.com>