Skip to content

Commit 29ddf48

Browse files
author
Shikha Jhala
committed
BZ2176838: Updated VM SSH procedure
1 parent 8149077 commit 29ddf48

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

modules/virt-accessing-vmi-ssh.adoc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
[id="virt-accessing-vmi-ssh_{context}"]
77
= Accessing a virtual machine via SSH by using virtctl
88

9-
You can use the `virtctl ssh` command to forward SSH traffic to a virtual machine (VM) by using your local SSH client.
9+
You can use the `virtctl ssh` command to forward SSH traffic to a virtual machine (VM) by using your local SSH client. If you have previously configured SSH key authentication with the VM, skip to step 2 of the procedure because step 1 is not required.
1010

1111
[NOTE]
1212
====
1313
Heavy SSH traffic on the control plane can slow down the API server. If you regularly need a large number of connections, use a dedicated Kubernetes `Service` object to access the virtual machine.
1414
====
1515

16+
1617
.Prerequisites
17-
* You have access to an {product-title} cluster with `cluster-admin` permissions.
1818
* You have installed the OpenShift CLI (`oc`).
1919
* You have installed the `virtctl` client.
2020
* The virtual machine you want to access is running.
@@ -23,22 +23,23 @@ Heavy SSH traffic on the control plane can slow down the API server. If you regu
2323
2424
.Procedure
2525

26-
. Use the `ssh-keygen` command to generate an SSH public key pair:
26+
. Configure SSH key authentication:
27+
.. Use the `ssh-keygen` command to generate an SSH public key pair:
2728
+
2829
[source,terminal]
2930
----
3031
$ ssh-keygen -f <key_file> <1>
3132
----
3233
<1> Specify the file in which to store the keys.
3334

34-
. Create an SSH authentication secret which contains the SSH public key to access the VM:
35+
.. Create an SSH authentication secret which contains the SSH public key to access the VM:
3536
+
3637
[source,terminal]
3738
----
3839
$ oc create secret generic my-pub-key --from-file=key1=<key_file>.pub
3940
----
4041

41-
. Add a reference to the secret in the `VirtualMachine` manifest. For example:
42+
.. Add a reference to the secret in the `VirtualMachine` manifest. For example:
4243
+
4344
[source,yaml]
4445
----
@@ -62,16 +63,17 @@ spec:
6263
<1> Reference to the SSH authentication `Secret` object.
6364
<2> The SSH public key is injected into the VM as cloud-init metadata using the `configDrive` provider.
6465

65-
. Restart the VM to apply your changes.
66+
.. Restart the VM to apply your changes.
6667

67-
. Run the following command to access the VM via SSH:
68+
. Connect to the VM via SSH:
69+
.. Run the following command to access the VM via SSH:
6870
+
6971
[source,terminal]
7072
----
7173
$ virtctl ssh -i <key_file> <vm_username>@<vm_name>
7274
----
7375

74-
. Optional: To securely transfer files to or from the VM, use the following commands:
76+
.. Optional: To securely transfer files to or from the VM, use the following commands:
7577
+
7678
7779
.Copy a file from your machine to the VM

0 commit comments

Comments
 (0)