Linux Password Less Authentication (rsa key file)

From PedrosBrainDump
Revision as of 16:50, 7 November 2024 by 413vhcu1lq0463ob (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
# Create key pair
ssh-keygen -t rsa -b 4096 -f ~/.ssh/username

# Add the public key to the `authorized_keys` file
cat ~/.ssh/username.pub >> ~/.ssh/authorized_keys

chmod 700 ~/.ssh             # Set the directory permissions
chmod 600 ~/.ssh/authorized_keys  # Set the file permissions