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 will be forwarded to the podman machine
22 ssh caller, see Exit Codes ⟨#Exit-Codes⟩.
23
24
25 Rootless only.
26
27
29 --help
30 Print usage statement.
31
32
33 --username=name
34 Username to use when SSH-ing into the VM.
35
36
38 The exit code from podman machine ssh gives information about why the
39 command failed. When podman machine ssh commands exit with a non-zero
40 code, the exit codes follow the chroot standard, see below:
41
42
43 125 The error is with podman itself
44
45
46 $ podman machine ssh --foo; echo $?
47 Error: unknown flag: --foo
48 125
49
50
51
52 126 Executing a contained command and the command cannot be invoked
53
54
55 $ podman machine ssh /etc; echo $?
56 Error: fork/exec /etc: permission denied
57 126
58
59
60
61 127 Executing a contained command and the command cannot be found
62
63
64 $ podman machine ssh foo; echo $?
65 Error: fork/exec /usr/bin/bogus: no such file or directory
66 127
67
68
69
70 Exit code contained command exit code
71
72
73 $ podman machine ssh /bin/sh -c 'exit 3'; echo $?
74 3
75
76
77
79 To get an interactive session with the default virtual machine:
80
81
82 $ podman machine ssh
83
84
85
86 To get an interactive session with a VM called myvm:
87
88
89 $ podman machine ssh myvm
90
91
92
93 To run a command on the default virtual machine:
94
95
96 $ podman machine ssh rpm -q podman
97
98
99
100 To run a command on a VM called myvm:
101
102
103 $ podman machine ssh myvm rpm -q podman
104
105
106
108 podman(1), podman-machine(1)
109
110
112 March 2021, Originally compiled by Ashley Cui acui@redhat.com
113 ⟨mailto:acui@redhat.com⟩
114
115
116
117 podman-machine-ssh(1)