Lando creates empty .ssh folder in app root
Thanks for Lando! I would like to report a simple but annoying bug.
Due to https://github.com/lando/cli/commit/582e22a6e01239c8af0448a3b89b6660dfc20248 when setting home: '' in ~/.lando/config.yml to avoid mounting the home folder as described in https://github.com/lando/lando/issues/2635#issuecomment-877473886 Lando creates an empty folder named .ssh in the app root (next to .lando.yml)
This happens since lando.config.home is an empty string, so path.join(lando.config.home, '.ssh') evaluates to .ssh and therefore creates the folder in the working directory.
Would you like a PR or is this simple enough for you to quick fix with something like for lines 64-66:
const sshDir = lando.config.home && path.join(lando.config.home, '.ssh');
// Ensure some dirs exist before we start
_.forEach([caDir, sshDir], dir => dir && mkdirp.sync(dir));
Thanks for all your efforts!
A PR would be great @michaellopez, thanks for pointing it out!
@reynoldsalec Here you go https://github.com/lando/cli/pull/135
You can avoid creating rogue .ssh paths by using an absolute path as the value... eg
home: '/Users/al/.lando-home-jail'
then it'll go and create the .ssh dir in that root. the .ssh dir is used to load your id_rsa up... so, if you change the home dir, you should probably also copy
\cp -fR ~/.gitconfig ~/.lando-home-jail \cp -fR ~/.ssh/id_rsa ~/.lando-home-jail/.ssh
@sonuku That's pretty clever, thanks