1podman-machine-ssh(1) General Commands Manual podman-machine-ssh(1)
2
3
4
6 podman-machine-ssh - SSH into a virtual machine
7
8
10 podman machine ssh [options] [name] [command [arg ...]]
11
12
14 SSH into a Podman-managed virtual machine and optionally execute a com‐
15 mand on the virtual machine. Unless using the default virtual machine,
16 the first argument must be the virtual machine name. The optional com‐
17 mand to execute can then follow. If no command is provided, an interac‐
18 tive session with the virtual machine is established.
19
20
21 The exit code from ssh command is forwarded to the podman machine ssh
22 caller, see Exit Codes ⟨#Exit-Codes⟩.
23
24
25 The default machine name is podman-machine-default. If a machine name
26 is not specified as an argument, then podman-machine-default will be
27 SSH'd into.
28
29
30 Rootless only.
31
32
34 --help
35 Print usage statement.
36
37
38 --username=name
39 Username to use when SSH-ing into the VM.
40
41
43 The exit code from podman machine ssh gives information about why the
44 command failed. When podman machine ssh commands exit with a non-zero
45 code, the exit codes follow the chroot standard, see below:
46
47
48 125 The error is with podman itself
49
50
51 $ podman machine ssh --foo; echo $?
52 Error: unknown flag: --foo
53 125
54
55
56
57 126 Executing a contained command and the command cannot be invoked
58
59
60 $ podman machine ssh /etc; echo $?
61 Error: fork/exec /etc: permission denied
62 126
63
64
65
66 127 Executing a contained command and the command cannot be found
67
68
69 $ podman machine ssh foo; echo $?
70 Error: fork/exec /usr/bin/bogus: no such file or directory
71 127
72
73
74
75 Exit code contained command exit code
76
77
78 $ podman machine ssh /bin/sh -c 'exit 3'; echo $?
79 3
80
81
82
84 To get an interactive session with the default virtual machine:
85
86
87 $ podman machine ssh
88
89
90
91 To get an interactive session with a VM called myvm:
92
93
94 $ podman machine ssh myvm
95
96
97
98 To run a command on the default virtual machine:
99
100
101 $ podman machine ssh rpm -q podman
102
103
104
105 To run a command on a VM called myvm:
106
107
108 $ podman machine ssh myvm rpm -q podman
109
110
111
113 podman(1), podman-machine(1)
114
115
117 March 2021, Originally compiled by Ashley Cui acui@redhat.com
118 ⟨mailto:acui@redhat.com⟩
119
120
121
122 podman-machine-ssh(1)