Difference between revisions of "Ssh keys"

From Leaky
Jump to: navigation, search
m (Added to Security category)
(Adding info about pageant)
 
Line 15: Line 15:
  
 
Obviously replace ''user'' with your username on that server, and ''servername'' with the actual server name (or IP address).
 
Obviously replace ''user'' with your username on that server, and ''servername'' with the actual server name (or IP address).
 +
 +
== Setting Pageant (PuTTY key agent) to run on startup ==
 +
 +
Open Windows Explorer and navigate to
 +
%appdata%\Microsoft\Windows\Start Menu\Programs\Startup
 +
 +
In Windows 10, simply click the down arrow to the right of the path and paste the above string in for direct navigation to the right folder.
 +
 +
Create a new Shortcut:
 +
 +
* Target: "C:\Program Files (x86)\PuTTY\pageant.exe" id_rsa.ppk second.ppk third.ppk
 +
* Start In: "%HOMEPATH%"
 +
 +
You can pre-load as many keys as you want. Simply add/remove additional .ppk files from the command line. You could also specify the full path to the .ppk file if it's not in your home directory.

Latest revision as of 07:26, 4 July 2016

On a Mac running OSX, you should be able to generate an SSH key with just a few commands, and then copy it onto any servers you login to regularly. The same commands should also work on any recent Linux distribution.

Check for existing SSH keys

$ ls -la ~/.ssh/

If there's anything in there such as id_rsa or id_dsa, you already have an SSH key and you should be careful not to overwrite them. The -f parameter for ssh-keygen will specify an alternative filename to write!

$ ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa_1

Once the key is generated (and be sure to protect it with a good passphrase), you can install it onto servers that you have password-based access to with this command.

$ ssh-copy-id user@servername

Obviously replace user with your username on that server, and servername with the actual server name (or IP address).

Setting Pageant (PuTTY key agent) to run on startup

Open Windows Explorer and navigate to %appdata%\Microsoft\Windows\Start Menu\Programs\Startup

In Windows 10, simply click the down arrow to the right of the path and paste the above string in for direct navigation to the right folder.

Create a new Shortcut:

  • Target: "C:\Program Files (x86)\PuTTY\pageant.exe" id_rsa.ppk second.ppk third.ppk
  • Start In: "%HOMEPATH%"

You can pre-load as many keys as you want. Simply add/remove additional .ppk files from the command line. You could also specify the full path to the .ppk file if it's not in your home directory.