From 64ef0709059797284705d6bb54ae81f3c194a116 Mon Sep 17 00:00:00 2001 From: Milson Munakami Date: Tue, 14 May 2024 21:17:31 -0400 Subject: [PATCH 1/4] added info on connecting the VM using SSH Config --- .../ssh-to-the-VM.md | 42 ++++++++++++++++++- .../using-vpn/openvpn/index.md | 2 +- .../using-vpn/sshuttle/index.md | 2 +- .../using-vpn/wireguard/index.md | 2 +- 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md b/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md index 023c4d56..ec28a5c4 100644 --- a/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md +++ b/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md @@ -51,10 +51,50 @@ sure you want to connect. Type `yes`. ![SSH To VM Successful](images/ssh_to_vm.png) -!!! tip "Note" +!!! tip "Important Note" If you haven't added your key to ssh-agent, you may need to specify the private key file, like this: `ssh -i ~/.ssh/cloud.key ubuntu@199.94.60.66` + To add your private key to the `ssh-agent` you can follow the following steps: + + 1. `eval "$(ssh-agent -s)"` + + Output: `Agent pid 59566` + + 2. `ssh-add ~/.ssh/cloud.key` + + If your private key is password protected, you'll be prompted to enter the + passphrase. + + 3. Verify that the key has been added by running `ssh-add -l`. + +## SSH to the VM using SSH Config + +**Alternatively,** You can also configure the setting for the remote instances in +your SSH configuration file (typically found in `~/.ssh/config`). The SSH configuration +file might include entry for your newly launched VM like this: + +```ssh +Host example + HostName 199.94.60.66 + User ubuntu + IdentityFile ~/.ssh/cloud.key +``` + +Here, the `Host` value can be any name you want; it is simply a label for the other +settings. The `Hostname` value is the **Floating IP** you have associated to your +instance that you want to access, the `User` value specifies the default account +username based on your base OS image used for the VM and `IdentityFile` specify +the path to your **Private Key** on your local machine. With this configuration +defined, you can connect to the account by simply using the Host value. You do +not have to type username, hostname, and private key each time. + +Then you can ssh into the your example VM running: + +```ssh +ssh example +``` + --- ## Setting a password diff --git a/docs/openstack/create-and-connect-to-the-VM/using-vpn/openvpn/index.md b/docs/openstack/create-and-connect-to-the-VM/using-vpn/openvpn/index.md index 8540b450..e89f0eef 100644 --- a/docs/openstack/create-and-connect-to-the-VM/using-vpn/openvpn/index.md +++ b/docs/openstack/create-and-connect-to-the-VM/using-vpn/openvpn/index.md @@ -36,7 +36,7 @@ The Security Groups attached to the OpenVPN server includes "**default**", Finally, you'll want to configure the setting for the remote instances in your SSH configuration file (typically found in `~/.ssh/config`). The SSH -configuration file might include entry for your newly create OpenVPN server +configuration file might include entry for your newly created OpenVPN server like this: ```sh diff --git a/docs/openstack/create-and-connect-to-the-VM/using-vpn/sshuttle/index.md b/docs/openstack/create-and-connect-to-the-VM/using-vpn/sshuttle/index.md index 3833d74f..38a4daa3 100644 --- a/docs/openstack/create-and-connect-to-the-VM/using-vpn/sshuttle/index.md +++ b/docs/openstack/create-and-connect-to-the-VM/using-vpn/sshuttle/index.md @@ -18,7 +18,7 @@ Also, attach a Floating IP to this instance so you can ssh into it from outside. Finally, you'll want to configure the setting for the remote instances in your SSH configuration file (typically found in `~/.ssh/config`). The SSH -configuration file might include entry for your newly create sshuttle server +configuration file might include entry for your newly created sshuttle server like this: ```sh diff --git a/docs/openstack/create-and-connect-to-the-VM/using-vpn/wireguard/index.md b/docs/openstack/create-and-connect-to-the-VM/using-vpn/wireguard/index.md index 8fa61a17..e584050b 100644 --- a/docs/openstack/create-and-connect-to-the-VM/using-vpn/wireguard/index.md +++ b/docs/openstack/create-and-connect-to-the-VM/using-vpn/wireguard/index.md @@ -29,7 +29,7 @@ The Security Groups attached to the WireGuard server includes "**default**", Finally, you'll want to configure the setting for the remote instances in your SSH configuration file (typically found in `~/.ssh/config`). The SSH -configuration file might include entry for your newly create WireGuard server +configuration file might include entry for your newly created WireGuard server like this: ```ssh From a8822c1f1fdcae09bef4291af381e5f63cdc6e5e Mon Sep 17 00:00:00 2001 From: Milson Munakami Date: Wed, 15 May 2024 09:52:24 -0400 Subject: [PATCH 2/4] fixed lint issues --- .../create-and-connect-to-the-VM/ssh-to-the-VM.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md b/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md index ec28a5c4..de329a6c 100644 --- a/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md +++ b/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md @@ -74,12 +74,10 @@ sure you want to connect. Type `yes`. your SSH configuration file (typically found in `~/.ssh/config`). The SSH configuration file might include entry for your newly launched VM like this: -```ssh -Host example - HostName 199.94.60.66 - User ubuntu - IdentityFile ~/.ssh/cloud.key -``` + Host example + HostName 199.94.60.66 + User ubuntu + IdentityFile ~/.ssh/cloud.key Here, the `Host` value can be any name you want; it is simply a label for the other settings. The `Hostname` value is the **Floating IP** you have associated to your @@ -91,9 +89,7 @@ not have to type username, hostname, and private key each time. Then you can ssh into the your example VM running: -```ssh -ssh example -``` + ssh example --- From f2e5d84ff63edd7c48dd1151c6f614cae9406b4e Mon Sep 17 00:00:00 2001 From: Milson Munakami Date: Fri, 17 May 2024 14:52:36 -0400 Subject: [PATCH 3/4] updated as per review --- .../create-and-connect-to-the-VM/ssh-to-the-VM.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md b/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md index de329a6c..040633a7 100644 --- a/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md +++ b/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md @@ -74,22 +74,17 @@ sure you want to connect. Type `yes`. your SSH configuration file (typically found in `~/.ssh/config`). The SSH configuration file might include entry for your newly launched VM like this: - Host example + Host ExampleHostLabel HostName 199.94.60.66 User ubuntu IdentityFile ~/.ssh/cloud.key -Here, the `Host` value can be any name you want; it is simply a label for the other -settings. The `Hostname` value is the **Floating IP** you have associated to your -instance that you want to access, the `User` value specifies the default account -username based on your base OS image used for the VM and `IdentityFile` specify -the path to your **Private Key** on your local machine. With this configuration -defined, you can connect to the account by simply using the Host value. You do -not have to type username, hostname, and private key each time. +Here, the `Host` value can be any label you want. The `HostName` value is the **Floating IP** you have associated to your instance that you want to access, the `User` value specifies the default account username based on your base OS image +used for the VM and `IdentityFile` specify the path to your **Private Key** on your local machine. With this configuration defined, you can connect to the account by simply using the Host value set as "ExampleHostLabel". You do not have to type the username, hostname, and private key each time. -Then you can ssh into the your example VM running: +So, you can SSH into your host VM by running: - ssh example + ssh ExampleHostLabel --- From 92abbbf9529d294359c89af4fd5ddbe73e9d7611 Mon Sep 17 00:00:00 2001 From: Milson Munakami Date: Fri, 17 May 2024 14:55:33 -0400 Subject: [PATCH 4/4] fixed the lint issues --- .../create-and-connect-to-the-VM/ssh-to-the-VM.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md b/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md index 040633a7..ed6366aa 100644 --- a/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md +++ b/docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md @@ -79,8 +79,13 @@ file might include entry for your newly launched VM like this: User ubuntu IdentityFile ~/.ssh/cloud.key -Here, the `Host` value can be any label you want. The `HostName` value is the **Floating IP** you have associated to your instance that you want to access, the `User` value specifies the default account username based on your base OS image -used for the VM and `IdentityFile` specify the path to your **Private Key** on your local machine. With this configuration defined, you can connect to the account by simply using the Host value set as "ExampleHostLabel". You do not have to type the username, hostname, and private key each time. +Here, the `Host` value can be any label you want. The `HostName` value is the +**Floating IP** you have associated to your instance that you want to access, the +`User` value specifies the default account username based on your base OS image +used for the VM and `IdentityFile` specify the path to your **Private Key** on +your local machine. With this configuration defined, you can connect to the account +by simply using the Host value set as "ExampleHostLabel". You do not have to type +the username, hostname, and private key each time. So, you can SSH into your host VM by running: