Differences
This shows you the differences between the selected revisions of the page.
2009-11-22 | 2009-11-22 | ||
created (martin) | completed (martin) | ||
Line 8: | Line 8: | ||
===== Generate Key Pair ===== | ===== Generate Key Pair ===== | ||
- | Start with [[public_key#generate|generating key pair]]. | + | If you do not have a key pair yet, start with [[public_key#generate|generating new key pair]]. |
+ | |||
+ | ===== Configure Server to Accept Public Key ===== | ||
+ | Connect to your SSH server using WinSCP with the SSH protocol, using other means of authentication than public key, e.g. typically using password authentication. | ||
+ | |||
+ | Once logged in, configure your server to accept your public key. That varies with SSH server software being used: | ||
+ | |||
+ | ==== OpenSSH ==== | ||
+ | [[task_navigate|Navigate]] into the ''.ssh'' subdirectory of your account home directory. You may need to enable [[ui_pref_panels#common_options|showing hidden files]] to see the directory. If the directory does not exists, you need to [[task_create_directory|create it]] first. | ||
+ | |||
+ | Once there, open the file ''authorized_keys'' for [[task_edit|editing]] ((In earlier versions of OpenSSH 2 the file might be called ''authorized_keys2''.)). Again you may have to create this file if this is the first key you have put in it. | ||
+ | |||
+ | Then switch to the [[ui_puttygen|PuTTYgen]] window, select all of the text in the //[[ui_puttygen#authorized_keys|Public key for pasting into authorized_keys file]]// box, and copy it to the clipboard (''Ctrl+C''). Then, switch back to the editor and insert the data into the open file, making sure it ends up all on one line. Save the file. | ||
+ | |||
+ | ==== ssh.com ==== | ||
+ | [[ui_puttygen#saving_public|Save a public key file]] from [[ui_puttygen|PuTTYgen]], and copy that into the ''.ssh2'' subdirectory of your account home directory. In the same subdirectory, [[task_edit|edit]] (or create) a file called ''authorization''. In this file you should put a line like ''Key mykey.pub'', with ''mykey.pub'' replaced by the name of your key file. | ||
+ | |||
+ | ==== Other SSH Servers ==== | ||
+ | For other SSH server software, you should refer to the manual for that server. | ||
+ | |||
+ | ==== Permissions ==== | ||
+ | You may also need to ensure that your home directory, your ''.ssh'' directory, and any other files involved (such as ''authorized_keys'', ''authorized_keys2'' or ''authorization'') are not group-writable or world-writable. | ||
+ | |||
+ | Read more about [[task_properties|changing permissions]] | ||
+ | |||
+ | ===== Configure WinSCP Session ===== | ||
+ | When configuring session, specify path to your private key on //[[ui_login_session#session_group|Session tab]]// of Login dialog. | ||
+ | |||
+ | Alternatively, Load the private key into [[public_key|Pageant]]. | ||
+ | |||
+ | ===== Further Reading ===== | ||
+ | * [[public_key|Using Public Keys for Authentication]]; | ||
+ | * [[ui_puttygen|Using PuTTYgen]]. | ||