104 lines
2.3 KiB
Groff
104 lines
2.3 KiB
Groff
.nh
|
|
.TH podman-machine-ssh 1
|
|
.SH NAME
|
|
podman-machine-ssh \- SSH into a virtual machine
|
|
|
|
.SH SYNOPSIS
|
|
\fBpodman machine ssh\fP [\fIoptions\fP] [\fIname\fP] [\fIcommand\fP [\fIarg\fP ...]]
|
|
|
|
.SH DESCRIPTION
|
|
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
|
|
Print usage statement.
|
|
|
|
.SS \fB--username\fP=\fIname\fP
|
|
Username to use when SSH-ing into the VM.
|
|
|
|
.SH Exit Codes
|
|
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
|
|
To get an interactive session with the default Podman machine:
|
|
|
|
.PP
|
|
SSH into the default Podman machine.
|
|
|
|
.EX
|
|
$ podman machine ssh
|
|
.EE
|
|
|
|
.PP
|
|
Run command inside the default Podman machine via ssh.
|
|
|
|
.EX
|
|
$ podman machine ssh myvm
|
|
.EE
|
|
|
|
.PP
|
|
Run command inside the specified Podman machine via ssh.
|
|
|
|
.EX
|
|
$ podman machine ssh myvm rpm -q podman
|
|
.EE
|
|
|
|
.SH SEE ALSO
|
|
\fBpodman(1)\fP, \fBpodman-machine(1)\fP
|
|
|
|
.SH HISTORY
|
|
March 2021, Originally compiled by Ashley Cui acui@redhat.com
|
|
\[la]mailto:acui@redhat.com\[ra]
|