Heath SchweitzerHeath Schweitzer
← All posts

Automated SSH Authentication using OpenSSH

August 24, 2010|Heath Schweitzer|1 min read|32 views|Last Updated June 20, 2026

LinuxWindowsMac

Generate a key on your local machine

ssh-keygen -t dsa

or

ssh-keygen -t rsa -b 4096

hit enter at the prompts and specifying a strong password

Copy the key to a remote machine

cat .ssh/id_dsa.pub | ssh username@hostname 'cat >> .ssh/authorized_keys'

or

cat .ssh/id_rsa.pub | ssh username@hostname 'cat >> .ssh/authorized_keys'

This should work whether you're using Cygwin on Windows, Mac OS X, or some flavor of Linux

If this post was useful, consider buying me a coffee ☕ with ₿itcoin — no account needed, any amount welcome.

Bitcoin tip QR code
⚡ Open in Wallet