non-square pixels

Posts

These are the posts

Re-laying Pipe Through SSH

You can easily and securely copy your ssh public key to a remote host using shell commands. This is far simpler than using files or even your system clipboard for that task. Here’s the one-liner:

cat ~/.ssh/id_rsa.pub | ssh myself@other-pc.local 'cat - >> ~/.ssh/authorized_keys'

The first part is straight forward: We pipe the contents of the user’s public key file to the ssh command.

cat ~/.ssh/id_rsa.pub # writes the contents to standard out.

Then, remember that you can pass a shell command to ssh which will be executed on the remote computer before the connection is closed again.