Difference between revisions of "Setting up Public key authentication"
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | {{Outdated}} |
||
+ | |||
=Windows= |
=Windows= |
||
Line 4: | Line 6: | ||
You will need: |
You will need: |
||
− | * PuTTY with PuTTYgen and Pageant. A complete installer can be downloaded from |
+ | * PuTTY with PuTTYgen and Pageant. A complete installer can be downloaded from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html. |
− | * WinSCP or other SFTP client. WinSCP can be downloaded from |
+ | * WinSCP or other SFTP client. WinSCP can be downloaded from https://winscp.net/eng/download.php. |
==Instructions== |
==Instructions== |
||
Line 14: | Line 16: | ||
# Save the Private key file. It should have an extension .ppk. |
# Save the Private key file. It should have an extension .ppk. |
||
# Copy the public key from the text box, then close PuTTYgen. |
# Copy the public key from the text box, then close PuTTYgen. |
||
− | # Open WinSCP or equivalent and connect to ''' |
+ | # Open WinSCP or equivalent and connect to '''warwick.film'''. Login with your username and password. |
# Open the directory '''.ssh''' (note the dot) or create it if it doesn't exist. |
# Open the directory '''.ssh''' (note the dot) or create it if it doesn't exist. |
||
# Open the file '''authorized_keys''' for editing, or create a new file if it doesn't exist. |
# Open the file '''authorized_keys''' for editing, or create a new file if it doesn't exist. |
||
# Paste in your public key, making sure it is on a single line. |
# Paste in your public key, making sure it is on a single line. |
||
+ | # Set permission on the '''.ssh''' directory to '''0700''' (rwx------) and on '''authorized_keys''' to '''0600''' (rw-------) |
||
# Close WinSCP or equivalent. |
# Close WinSCP or equivalent. |
||
Line 32: | Line 35: | ||
# Does the paste string for authorized_keys need bits removing from each end? |
# Does the paste string for authorized_keys need bits removing from each end? |
||
+ | #* The complete string should be used - the initial '''ssh-rsa''' or equivalent should be followed by a space then the key, ending in '''<nowiki>==</nowiki>'''. The bit at the end is a comment that you can use to identify the key, eg <username>@<hostname> |
||
+ | # Public key is not accepted. |
||
+ | #* Make sure that the correct permissions are set on your '''.ssh''' directory and '''authorized_keys''' file. They should be '''0700''' and '''0600''' respectively. |
||
[[Category:IT]] |
[[Category:IT]] |
Latest revision as of 22:59, 9 February 2019
IMPORTANT: The content of this page is outdated. If you have checked or updated this page and found the content to be suitable, please remove this notice. |
Windows
Requirements
You will need:
- PuTTY with PuTTYgen and Pageant. A complete installer can be downloaded from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html.
- WinSCP or other SFTP client. WinSCP can be downloaded from https://winscp.net/eng/download.php.
Instructions
- Open PuTTYgen.
- Click 'Generate' to create a new key.
- Enter a passphrase.
- Save the Private key file. It should have an extension .ppk.
- Copy the public key from the text box, then close PuTTYgen.
- Open WinSCP or equivalent and connect to warwick.film. Login with your username and password.
- Open the directory .ssh (note the dot) or create it if it doesn't exist.
- Open the file authorized_keys for editing, or create a new file if it doesn't exist.
- Paste in your public key, making sure it is on a single line.
- Set permission on the .ssh directory to 0700 (rwx------) and on authorized_keys to 0600 (rw-------)
- Close WinSCP or equivalent.
Usage
- Open Pageant: an icon should appear in the system tray.
- (Right-)click the icon and select add key.
- Open your private keyfile and enter your passphrase when requested.
Programs such as PuTTY, WinSCP, bzr, etc. should automatically detect the loaded key and use that for authentication - just supply your username where relevant.
Troubleshooting
Okay, so I can't get this to work. If you succeed, please answer following;
- Does the paste string for authorized_keys need bits removing from each end?
- The complete string should be used - the initial ssh-rsa or equivalent should be followed by a space then the key, ending in ==. The bit at the end is a comment that you can use to identify the key, eg <username>@<hostname>
- Public key is not accepted.
- Make sure that the correct permissions are set on your .ssh directory and authorized_keys file. They should be 0700 and 0600 respectively.