.nh .TH podman-machine-ssh 1 .SH NAME .PP podman-machine-ssh - SSH into a virtual machine .SH SYNOPSIS .PP \fBpodman machine ssh\fP [\fIoptions\fP] [\fIname\fP] [\fIcommand\fP [\fIarg\fP ...]] .SH DESCRIPTION .PP SSH into a Podman-managed virtual machine and optionally execute a command on the virtual machine. Unless using the default virtual machine, the first argument must be the virtual machine name. The optional command to execute can then follow. If no command is provided, an interactive session with the virtual machine is established. .PP The exit code from ssh command is forwarded to the podman machine ssh caller, see Exit Codes \[la]#Exit\-Codes\[ra]\&. .PP The default machine name is \fBpodman-machine-default\fR\&. If a machine name is not specified as an argument, then \fBpodman-machine-default\fR will be SSH'd into. .PP Rootless only. .SH OPTIONS .SS \fB--help\fP .PP Print usage statement. .SS \fB--username\fP=\fIname\fP .PP Username to use when SSH-ing into the VM. .SH Exit Codes .PP The exit code from \fBpodman machine ssh\fR gives information about why the command failed. When \fBpodman machine ssh\fR commands exit with a non-zero code, the exit codes follow the \fBchroot\fR standard, see below: .PP \fB125\fP The error is with podman \fB\fIitself\fP\fP .EX $ podman machine ssh --foo; echo $? Error: unknown flag: --foo 125 .EE .PP \fB126\fP Executing a \fIcontained command\fP and the \fIcommand\fP cannot be invoked .EX $ podman machine ssh /etc; echo $? Error: fork/exec /etc: permission denied 126 .EE .PP \fB127\fP Executing a \fIcontained command\fP and the \fIcommand\fP cannot be found .EX $ podman machine ssh foo; echo $? Error: fork/exec /usr/bin/bogus: no such file or directory 127 .EE .PP \fBExit code\fP \fIcontained command\fP exit code .EX $ podman machine ssh /bin/sh -c 'exit 3'; echo $? 3 .EE .SH EXAMPLES .PP To get an interactive session with the default virtual machine: .EX $ podman machine ssh .EE .PP To get an interactive session with a VM called \fBmyvm\fR: .EX $ podman machine ssh myvm .EE .PP To run a command on the default virtual machine: .EX $ podman machine ssh rpm -q podman .EE .PP To run a command on a VM called \fBmyvm\fR: .EX $ podman machine ssh myvm rpm -q podman .EE .SH SEE ALSO .PP \fBpodman(1)\fP, \fBpodman-machine(1)\fP .SH HISTORY .PP March 2021, Originally compiled by Ashley Cui acui@redhat.com \[la]mailto:acui@redhat.com\[ra]