Skip to content

Commit 64ef070

Browse files
committed
added info on connecting the VM using SSH Config
1 parent f1905f5 commit 64ef070

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed

docs/openstack/create-and-connect-to-the-VM/ssh-to-the-VM.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,50 @@ sure you want to connect. Type `yes`.
5151

5252
![SSH To VM Successful](images/ssh_to_vm.png)
5353

54-
!!! tip "Note"
54+
!!! tip "Important Note"
5555
If you haven't added your key to ssh-agent, you may need to specify the
5656
private key file, like this: `ssh -i ~/.ssh/cloud.key [email protected]`
5757

58+
To add your private key to the `ssh-agent` you can follow the following steps:
59+
60+
1. `eval "$(ssh-agent -s)"`
61+
62+
Output: `Agent pid 59566`
63+
64+
2. `ssh-add ~/.ssh/cloud.key`
65+
66+
If your private key is password protected, you'll be prompted to enter the
67+
passphrase.
68+
69+
3. Verify that the key has been added by running `ssh-add -l`.
70+
71+
## SSH to the VM using SSH Config
72+
73+
**Alternatively,** You can also configure the setting for the remote instances in
74+
your SSH configuration file (typically found in `~/.ssh/config`). The SSH configuration
75+
file might include entry for your newly launched VM like this:
76+
77+
```ssh
78+
Host example
79+
HostName 199.94.60.66
80+
User ubuntu
81+
IdentityFile ~/.ssh/cloud.key
82+
```
83+
84+
Here, the `Host` value can be any name you want; it is simply a label for the other
85+
settings. The `Hostname` value is the **Floating IP** you have associated to your
86+
instance that you want to access, the `User` value specifies the default account
87+
username based on your base OS image used for the VM and `IdentityFile` specify
88+
the path to your **Private Key** on your local machine. With this configuration
89+
defined, you can connect to the account by simply using the Host value. You do
90+
not have to type username, hostname, and private key each time.
91+
92+
Then you can ssh into the your example VM running:
93+
94+
```ssh
95+
ssh example
96+
```
97+
5898
---
5999

60100
## Setting a password

docs/openstack/create-and-connect-to-the-VM/using-vpn/openvpn/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The Security Groups attached to the OpenVPN server includes "**default**",
3636

3737
Finally, you'll want to configure the setting for the remote instances in your
3838
SSH configuration file (typically found in `~/.ssh/config`). The SSH
39-
configuration file might include entry for your newly create OpenVPN server
39+
configuration file might include entry for your newly created OpenVPN server
4040
like this:
4141

4242
```sh

docs/openstack/create-and-connect-to-the-VM/using-vpn/sshuttle/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Also, attach a Floating IP to this instance so you can ssh into it from outside.
1818

1919
Finally, you'll want to configure the setting for the remote instances in your
2020
SSH configuration file (typically found in `~/.ssh/config`). The SSH
21-
configuration file might include entry for your newly create sshuttle server
21+
configuration file might include entry for your newly created sshuttle server
2222
like this:
2323

2424
```sh

docs/openstack/create-and-connect-to-the-VM/using-vpn/wireguard/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The Security Groups attached to the WireGuard server includes "**default**",
2929

3030
Finally, you'll want to configure the setting for the remote instances in your
3131
SSH configuration file (typically found in `~/.ssh/config`). The SSH
32-
configuration file might include entry for your newly create WireGuard server
32+
configuration file might include entry for your newly created WireGuard server
3333
like this:
3434

3535
```ssh

0 commit comments

Comments
 (0)