1podman-machine-ssh(1)       General Commands Manual      podman-machine-ssh(1)
2
3
4

NAME

6       podman-machine-ssh - SSH into a virtual machine
7
8

SYNOPSIS

10       podman machine ssh [options] [name] [command [arg ...]]
11
12

DESCRIPTION

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

OPTIONS

34   --help
35       Print usage statement.
36
37
38   --username=name
39       Username to use when SSH-ing into the VM.
40
41

Exit Codes

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       $ podman machine ssh --foo; echo $?
51       Error: unknown flag: --foo
52       125
53
54
55
56       126 Executing a contained command and the command cannot be invoked
57
58       $ podman machine ssh /etc; echo $?
59       Error: fork/exec /etc: permission denied
60       126
61
62
63
64       127 Executing a contained command and the command cannot be found
65
66       $ podman machine ssh foo; echo $?
67       Error: fork/exec /usr/bin/bogus: no such file or directory
68       127
69
70
71
72       Exit code contained command exit code
73
74       $ podman machine ssh /bin/sh -c 'exit 3'; echo $?
75       3
76
77
78

EXAMPLES

80       To get an interactive session with the default virtual machine:
81
82       $ podman machine ssh
83
84
85
86       To get an interactive session with a VM called myvm:
87
88       $ podman machine ssh myvm
89
90
91
92       To run a command on the default virtual machine:
93
94       $ podman machine ssh rpm -q podman
95
96
97
98       To run a command on a VM called myvm:
99
100       $ podman machine ssh  myvm rpm -q podman
101
102
103

SEE ALSO

105       podman(1), podman-machine(1)
106
107

HISTORY

109       March  2021,  Originally  compiled  by   Ashley   Cui   acui@redhat.com
110       ⟨mailto:acui@redhat.com⟩
111
112
113
114                                                         podman-machine-ssh(1)
Impressum