10月 07, 2016

Notebook: to establish certificate authentication on a server without generating key on windows



This is for people who do not want to generate key files on Windows directly, it's totally optional.

First of all, there is a man, there is a plan. Ugh...
First of all, make sure a ssh2 compatible server is installed on the server, a client of ssh is installed on the windows client.[bullshit] The server I am using is Xshell.

Then,
1. do ssh-keygen on the server [preferably to include the flag "-t ed25519" / "-t ecdsa" for higher efficiency encryption], optionally you can type a passphrase

2. Use any method to copy the private key file [the file with no *.pub suffix] which is newly generated in ~/.ssh of the server to your client

3. Include the new pub-key into the whitelist on the server by r
a. renaming&moving "mv [file.pub] ~/.ssh/authorized_keys"
b. appending the existing whitelist "cat [file.pub] >> ~/.ssh/authorized_keys"

4. Protect the file from being changed by other users --
"chmod 600 ~/.ssh/authorized_keys"

5. Go to the Windows client, and then import the private key copied from the server by the tool as shown.

*Chinese interface*


Partially referenced ArchWiki
1.https://wiki.archlinux.org/index.php/SSH_keys#Choosing_the_key_location_and_passphrase

沒有留言:

張貼留言