From 236e67661f6a9acf7e964c89fdc201579e509335 Mon Sep 17 00:00:00 2001 From: Francisco Rivera Date: Tue, 10 Oct 2023 11:36:09 -0300 Subject: [PATCH] [BB-173] SSH config folder documentation (#191) * ssh config folder doc * Update docs/user-guide/leverage-cli/private-repositories.md Co-authored-by: Diego OJeda (BinBash) <38356409+diego-ojeda-binbash@users.noreply.github.com> * wording corrections * mac 12.5 daemon warning * more precise instructions * tf init ssh multiple associated keys --------- Co-authored-by: Diego OJeda (BinBash) <38356409+diego-ojeda-binbash@users.noreply.github.com> --- docs/user-guide/leverage-cli/installation.md | 4 ++++ .../user-guide/leverage-cli/private-repositories.md | 13 +++++++++++++ docs/user-guide/troubleshooting/general.md | 11 +++++++++++ 3 files changed, 28 insertions(+) diff --git a/docs/user-guide/leverage-cli/installation.md b/docs/user-guide/leverage-cli/installation.md index 214ddb6f..9d896ab7 100644 --- a/docs/user-guide/leverage-cli/installation.md +++ b/docs/user-guide/leverage-cli/installation.md @@ -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" diff --git a/docs/user-guide/leverage-cli/private-repositories.md b/docs/user-guide/leverage-cli/private-repositories.md index 27d9d489..97ca7fa1 100644 --- a/docs/user-guide/leverage-cli/private-repositories.md +++ b/docs/user-guide/leverage-cli/private-repositories.md @@ -31,3 +31,16 @@ $ eval "$(ssh-agent -s)" $ ssh-add ~/.ssh/ ``` (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 +``` diff --git a/docs/user-guide/troubleshooting/general.md b/docs/user-guide/troubleshooting/general.md index f9f384ee..422e2279 100644 --- a/docs/user-guide/troubleshooting/general.md +++ b/docs/user-guide/troubleshooting/general.md @@ -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.