Open royallthefourth opened 5 years ago
This was always intended to be separate, it would just create an SSH key via the normal ssh-keygen
(which defaults to ~/.ssh/id_rsa
) and then you'd proceed to use SSH via the normal ssh
(which searches for keys in a handful of well known paths like ~/.ssh/id_rsa
).
If you have a key in a non-standard location then the usual solution is to add it to an SSH agent, hence the tip here: https://github.com/platformsh/platformsh-cli/blob/4803c7ca2b1afe47ea310aeb4e1a9e961ad0b8d4/src/Command/SshKey/SshKeyAddCommand.php#L53-L58
But here /var/www/.ssh/id_rsa
is being used as a standard location for key generation (ssh-keygen) because /var/www
is the home directory, and /user/.ssh
is being used by the SSH client because suddenly /user
is the home directory. It sounds like Lando is messing up $HOME
.
I guess there's some potential of having CLI-specific keys that are searched and added via SSH config (that would be a feature request), but that would be confusing for users who want to use vanilla ssh
or other SSH-based tools like rsync
, Drush, etc.
A user reports that
ssh:add
does not always store a newly generated key in the same search path that's used byenvironment:ssh
. This is particularly confusing in Lando environments that generate a key at/var/www/.ssh
, then search for keys in/user/.ssh
at connection time.See the full example below from @gilzow:
Before doing anything:
Redeployed master: