Describe the bug
macOS Mojave: Connection to a third-party server fails because of missing ssh-key in container. Connectiion from host works.
To Reproduce
Aside of ~/.ssh/id_rsa I have a second ssh-key ~/.ssh/juergen_key
I added this key with 'ssh-add' on my host. I also permanently added it to my hosts ~/.ssh/config file.
runing 'ddev auth ssh' replies:
Enter passphrase for /home/.ssh/id_rsa:
Identity added: /home/.ssh/id_rsa (/home/.ssh/id_rsa)
The second ssh key is ignored.
Expected behavior
I expected the second key to be imported to the ddev container as well.
Alternatively by using an argument such as: ddev auth ssh ~/.ssh/juergen_key
Version and configuration information (please complete the following information):
macOS mojave 10.14.1
docker --version
Docker version 18.09.0, build 4d60db4
ddev version
cli v1.4.0
dba drud/phpmyadmin:v1.4.0
router drud/ddev-router:v1.4.0
ddev-ssh-agent drud/ddev-ssh-agent:v1.4.0
web drud/ddev-webserver:v1.4.0
db drud/ddev-dbserver:v1.4.0
commit v1.4.0
domain ddev.local
without any custom configuration (nginx, php, mysql) in the .ddev folder.
Currently it just adds keys named id_rsa and id_dsa. We probably need to figure out how to get it to add generic keys.
As a workaround, you can copy your juergen_key to a different directory (maybe ~/.ssh_extra as id_rsa, and then ddev auth ssh -d ~/.ssh_extra
@rfay What about adding a new key ssh_keys: ["other_key"] in config.yaml, which will load all keys from the default .ssh directory? Probably I don't even need the specific key named id_rsa for the project.
I also run into this, as I have a couple of keys with different security settings (e.g. some don't have passwords).
I think it just needs to try to read all the keys.
@juergen-venne @dahaupt I'd love if you could take the PR #1295 for a test run, it should pick up any keys (of any type) in ~/.ssh or the directory you specify with -d. Build artifacts to try out are at https://circleci.com/gh/drud/ddev/6142#artifacts/containers/0
@rfay I just tested it and it's working fine! Thank you for the fast PR! 馃檪
@rfay Thank you, works perfectly!
Thanks so much for your testing @dahaupt @juergen-venne !
Most helpful comment
@juergen-venne @dahaupt I'd love if you could take the PR #1295 for a test run, it should pick up any keys (of any type) in ~/.ssh or the directory you specify with -d. Build artifacts to try out are at https://circleci.com/gh/drud/ddev/6142#artifacts/containers/0