07-01-2018, 02:25 AM
Step 1: Navigate to the link below and download PuttyGen for either 32 or 64 bit VPS
https://www.chiark.greenend.org.uk/~sgta...atest.html
Step 2: Create a Keys Folder in a safe area of your computer and move the puttygen.exe file into the Keys Folder
Step 3: Open the puttygen.exe file as indicated below and generate a Private.ppk key
Step4: Save the private.ppk file to the Keys Folder as indicated below.
Step 5: Copy the contents of the Public Key below to the clipboard/notepad
Step 6: Access your VPS with SSH to add the PuttyGen Key with the following commands
mkdir ~/.ssh
touch ~/.ssh/authorized_keys
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys
paste the contents of the public key that you copied before to notepad to the 'authorized' keys file
ctrl x to exit and accept and ctrl y
Check that you have made the change to the authorized keys successfully and it now contains your private key. Then exit the VPS.
Step 8: Open up your Putty Again and load your VPS as with the diagram below.
Step 9: Click on the SSH link in the left column below and then select 'auth'. Use the "browse" tool to
select the private.ppk file in your Keys Folder.
Step 10: Open the VPS
Step 11: Once you've checked that the keys are working you can now disallow password authentication:
Search with ctrl + w passwordauthentication yes
Change it to 'no'
Then exit with ctrl+x and y
Check that the change has been made successfully with nano
Now check whether you can access root with a password. You should not be able to do so.
https://www.chiark.greenend.org.uk/~sgta...atest.html
Step 2: Create a Keys Folder in a safe area of your computer and move the puttygen.exe file into the Keys Folder
Step 3: Open the puttygen.exe file as indicated below and generate a Private.ppk key
Step4: Save the private.ppk file to the Keys Folder as indicated below.
Step 5: Copy the contents of the Public Key below to the clipboard/notepad
Step 6: Access your VPS with SSH to add the PuttyGen Key with the following commands
mkdir ~/.ssh
touch ~/.ssh/authorized_keys
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys
paste the contents of the public key that you copied before to notepad to the 'authorized' keys file
ctrl x to exit and accept and ctrl y
Check that you have made the change to the authorized keys successfully and it now contains your private key. Then exit the VPS.
Step 8: Open up your Putty Again and load your VPS as with the diagram below.
Step 9: Click on the SSH link in the left column below and then select 'auth'. Use the "browse" tool to
select the private.ppk file in your Keys Folder.
Step 10: Open the VPS
Step 11: Once you've checked that the keys are working you can now disallow password authentication:
Code: (Select All)
nano /etc/ssh/sshd_config
Search with ctrl + w passwordauthentication yes
Change it to 'no'
Then exit with ctrl+x and y
Check that the change has been made successfully with nano
Now check whether you can access root with a password. You should not be able to do so.