Skip to content

Commit

Permalink
[BB-173] SSH config folder documentation (#191)
Browse files Browse the repository at this point in the history
* ssh config folder doc

* Update docs/user-guide/leverage-cli/private-repositories.md

Co-authored-by: Diego OJeda (BinBash) <[email protected]>

* wording corrections

* mac 12.5 daemon warning

* more precise instructions

* tf init ssh  multiple associated keys

---------

Co-authored-by: Diego OJeda (BinBash) <[email protected]>
  • Loading branch information
Franr and diego-ojeda-binbash authored Oct 10, 2023
1 parent dfcfd50 commit 236e676
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/user-guide/leverage-cli/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ To use Leverage CLI you need to install it from the Python Package Index (Pypi).
* [x] **Git** `>= 2.25`
* [x] **Docker engine** `>= 20.x.y`

!!! warning "Docker daemon doesn't seem to be responding"
If you are using Docker Desktop on macOS 12.5 or above, right click on your Docker Desktop task bar icon,
then “Settings …“, under “General” , make sure to choose osxfs (legacy) as your file sharing implementation.

###Install Pip

=== "Ubuntu/Debian"
Expand Down
13 changes: 13 additions & 0 deletions docs/user-guide/leverage-cli/private-repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@ $ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/<private_ssh_key_file>
```
(replace `private_ssh_key_file` with the desired file, the process can request the passphrase if it was set on key creation step)

## Using the SSH config file to specify the key that must be used for a given host

The ssh-agent socket is not always available in all the OS, like in Mac. So now our `leverage terraform init` command copies the ssh config file (and the whole .ssh directory) into the container volume, which means any custom configuration you have there,
will be used. You can read more on the [ssh official documentation](https://www.ssh.com/academy/ssh/config).

If, for example, you need to use a custom key for your private repositories on gitlab, you could add a block to your `ssh config` file, specifying:

```
host gitlab.com
HostName gitlab.com
IdentityFile ~/.ssh/my_gitlab_key
```
11 changes: 11 additions & 0 deletions docs/user-guide/troubleshooting/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,14 @@ They are stored in 2 files: `config` and `credentials`.
By default, the AWS CLI will create those files under this path: `~/.aws/` but Leverage uses a slightly different convention, so they should actually be located in this path: `~/.aws/[project_name_here]/`.

So, for instance, if your project name is `acme`, then said files should be found under: `~/.aws/acme/config` and `~/.aws/acme/credentials`.

## SSH reiterative confirmation

If you get a reiterative dialog for confirmation while running a `leverage terraform init` :
```
Warning: the ECDSA host key for 'YYY' differs from the key for the IP address 'ZZZ.ZZZ.ZZZ.ZZZ'
Offending key for IP in /root/.ssh/known_hosts:xyz
Matching host key in /root/.ssh/known_hosts:xyw
Are you sure you want to continue connecting (yes/no)?
```
You may have more than 1 key associated to the `YYY` host. Remove the old or incorrect one, and the dialog should stop.

0 comments on commit 236e676

Please sign in to comment.