4 ms·
apparently it's in homebrew (see other comment), but for half an eternity, I've always been using this: ssh user@host "mkdir .ssh && cat >> .ssh/authorized
by pilif 15y ago
apparently it's in homebrew (see other comment), but for half an eternity, I've always been using this:
ssh user@host "mkdir .ssh && cat >> .ssh/authorized_keys" < ~/.ssh/id_rsa.pub
(remove the mkdir if .ssh already exists)
This works as well and is using nothing but the power of the unix shell and the concept of pipes.
- cjp 15y agoUse mkdir -p to avoid failing if .ssh already exists. ssh user@host "mkdir -p .ssh && cat >> .ssh/authorized_keys" < ~/.ssh/id_rsa.pub