// Module included in the following assemblies:
//
// microshift_install_rpm/microshift-install-rpm.adoc
// microshift_install_rpm_ostree/microshift-embed-in-rpm-ostree.adoc
// microshift_configuring/microshift-access-node-kubeconfig.adoc

:_mod-docs-content-type: PROCEDURE
[id="accessing-microshift-node-remotely_{context}"]
= Accessing the {microshift-short} node remotely

[role="_abstract"]
Access the {microshift-short} service from a remote location by using a `kubeconfig` file.

The `user@workstation` login is used to access the host machine remotely. The `<user>` value in the procedure is the name of the user that `user@workstation` logs in with to the {microshift-short} host.

.Prerequisites

* You installed {oc-first}.
* The `user@microshift` has opened the firewall from the local host.
* You generated additional `kubeconfig` files.

.Procedure

. As `user@workstation`, create a `~/.kube/` folder if your {op-system-base-full} machine does not have one by running the following command:
+
[source,terminal]
----
[user@workstation]$ mkdir -p ~/.kube/
----

. As `user@workstation`, set a variable for the hostname of your {microshift-short} host by running the following command:
+
[source,terminal,subs="+quotes"]
----
[user@workstation]$ MICROSHIFT_MACHINE=_<microshift_hostname>_
----
+
Replace the value, _<{microshift-short}_hostname>_, with the either the name or the IP address of the host running {microshift}.

. As `user@workstation`, copy the generated `kubeconfig` file that contains the hostname or IP address you want to connect to from the {op-system-base} machine running {microshift-short} to your local machine by running the following command:
+
[source,terminal,subs="+quotes"]
----
[user@workstation]$ ssh _<user>_@$MICROSHIFT_MACHINE "sudo cat /var/lib/microshift/resources/kubeadmin/$MICROSHIFT_MACHINE/kubeconfig" > ~/.kube/config #
----
+
Replace _<user>_ with your SSH login credentials.

. As `user@workstation`, update the permissions on your `~/.kube/config` file by running the following command:
+
[source,terminal]
----
$ chmod go-r ~/.kube/config
----

.Verification

* As `user@workstation`, verify that {microshift-short} is running by entering the following command:
+
--
include::snippets/microshift-healthy-pods-snip.adoc[leveloffset=+2]
--