How To setup SSH Key Authentication on Linux

This short tutorial explains how to setup SSH to use key based authentication, by default on CentOS this is disabled. To start with follow our guide on how to generate SSH key pairs and copy the key over.

Configure SSH to enable Public Key Based Authentication

Open up /etc/sshd_config in vi and find the following lines:

#PubkeyAuthentication yes
#AuthorizedKeysFile      .ssh/authorized_keys

And un-comment them so it reads:

PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys

Restart SSH Server with:

/etc/init.d/sshd restart

You should now be able to login over SSH using public key based authentication.

Article source:

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
This entry was posted in Little Guides, Usefully Found Stuff and tagged , , , , . Bookmark the permalink.

Comments are closed.