0% found this document useful (0 votes)
67 views2 pages

SSH Public Keys Based Authentication Quick Guide

This document provides a quick guide to configuring public key authentication for SSH. It outlines the steps to generate a public/private key pair on the workstation, copy the public key to the server, and configure the server to use public key authentication. Tips are also provided on managing passphrases and deleting keys. The SSH daemon must be configured to enable RSA authentication and public key authentication and use the authorized_keys2 file for the public keys.

Uploaded by

wanna_ac
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views2 pages

SSH Public Keys Based Authentication Quick Guide

This document provides a quick guide to configuring public key authentication for SSH. It outlines the steps to generate a public/private key pair on the workstation, copy the public key to the server, and configure the server to use public key authentication. Tips are also provided on managing passphrases and deleting keys. The SSH daemon must be configured to enable RSA authentication and public key authentication and use the authorized_keys2 file for the public keys.

Uploaded by

wanna_ac
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

FreeBSD Online

SSH Public Keys Based Authentication Quick Guide

Here is a mini Howto about configuring your SSH service to work with Public Keys Based Authentication. So, you have a BSD Workstation and you want to connect via SSH to a BSD Server using Public Keys Based Authentication. Step 1. Login to your BSD Workstation to create your Private/Public Keys. ------------------------------------------------------------------------------------------------# ssh-keygen -t rsa You will be prompted to enter file in which to save the key (/home/user/.ssh/id_rsa). Then you will be prompted to enter a passphrase.You can also choose not to add a passphrase, in which case you press enter. Your identification has been saved in /home/user/.ssh/id_rsa. Your public key has been saved in /home/user/.ssh/id_rsa.pub.

Step 2. Copy your public key (id_rsa.pub) to your BSD Server using scp ---------------------------------------------------------------------------------------------# scp /home/user/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys2

If you need to connect to your server from multiple BSD stations you must generate Private/Public Keys on each workstations then append content of id_rsa.pub files from every workstation to your authorized_keys2 file from your server. Tips -----a) Change passphrase on your workstation: # ssh-keygen -p

b) Manage your passphrase with ssh-agent, in order not to input passphrase at every ssh auth. On your workstation type: # ssh-agent $BASH # ssh-add

Then type your passphrase. From now on, you will not be prompted to enter a password. c) List keys # ssh-add -l d) Delete a key # ssh-add -d key (-D to delete all keys) Notes ------Your sshd config file should contain: RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys2
http://www.freebsdonline.com Powered by Joomla! Generated: 20 June, 2011, 10:45

FreeBSD Online

In order to properly work, rights to authorized_keys2 shoud be 600 Default authorized keys is in .ssh/authorized_keys

http://www.freebsdonline.com

Powered by Joomla!

Generated: 20 June, 2011, 10:45

You might also like