10-21-2015, 04:45 PM
Hello everyone,
In this tutorial I'm going to show that how can you create passwordless login to VPS.
1. Download PuTTY Key Generator from here: http://the.earth.li/~sgtatham/putty/late...ttygen.exe
And then start it.
2. You can change "number of bits in a generated key" to "4096" if you would like to be more secure.
3. Then click to Generate and make some random moves with your mouse.
4. When It's finished, then save Public and then save Private key to a safe location on your HDD and to a second place too, for example a flashdrive.
It will ask that "Are you sure that you want to save this key without passphrase to protect it?".
Simple click to Yes.
5. Create a new text file with authorized_keys.txt name and copy the PuTTY Key Generator's windows content into this file.
6. Login to your VPS over SSH with root.
7. Enter these commands:
To check where you are, you must be in your home directory
If you are not in home, then you must go there
To create a new .ssh directory
To create and edit authorized_keys file
(if you get a "-bash: nano: command not found" error then you must first install nano with "apt-get install nano" command)
Simple copy your authorized_keys.txt file's content to this newly created file or you can copy directly from PuTTY Key Generator's windows content into this file.
Save and exit.
8. Enter these command to modify permissions
9. Open and edit sshd_config file
Search the PermitRootLogin line.
Delete "Yes" or "No" and replace with "without-password".
Save changes and exit from nano.
9. Restart your VPS
10. Locate your private key in Putty
/Connection/SSH/Auth/Browse
11. Save connection in Putty and Connect
In this example I entered Google's DNS IP address (8.8.8.8). You have to replace it with your own VPS's IP address.
If you changed your SSH port in the previous tutorial then don't forget to use the right port.
Under the "Saved Sessions" enter your VPS's name (for example Post4VPS) and then click to save.
And you are ready. Putty won't ask for password anymore!
Please use the ⇩ button below. Thx.
In this tutorial I'm going to show that how can you create passwordless login to VPS.
1. Download PuTTY Key Generator from here: http://the.earth.li/~sgtatham/putty/late...ttygen.exe
And then start it.
2. You can change "number of bits in a generated key" to "4096" if you would like to be more secure.
3. Then click to Generate and make some random moves with your mouse.
4. When It's finished, then save Public and then save Private key to a safe location on your HDD and to a second place too, for example a flashdrive.
It will ask that "Are you sure that you want to save this key without passphrase to protect it?".
Simple click to Yes.
5. Create a new text file with authorized_keys.txt name and copy the PuTTY Key Generator's windows content into this file.
6. Login to your VPS over SSH with root.
7. Enter these commands:
Code: (Select All)
pwd
Code: (Select All)
cd ~
Code: (Select All)
mkdir .ssh
Code: (Select All)
nano .ssh/authorized_keys
(if you get a "-bash: nano: command not found" error then you must first install nano with "apt-get install nano" command)
Simple copy your authorized_keys.txt file's content to this newly created file or you can copy directly from PuTTY Key Generator's windows content into this file.
Save and exit.
8. Enter these command to modify permissions
Code: (Select All)
chmod -R 700 .ssh/
9. Open and edit sshd_config file
Code: (Select All)
nano /etc/ssh/sshd_config
Delete "Yes" or "No" and replace with "without-password".
Code: (Select All)
PermitRootLogin without-password
9. Restart your VPS
Code: (Select All)
reboot
10. Locate your private key in Putty
/Connection/SSH/Auth/Browse
11. Save connection in Putty and Connect
In this example I entered Google's DNS IP address (8.8.8.8). You have to replace it with your own VPS's IP address.
If you changed your SSH port in the previous tutorial then don't forget to use the right port.
Under the "Saved Sessions" enter your VPS's name (for example Post4VPS) and then click to save.
And you are ready. Putty won't ask for password anymore!
Please use the ⇩ button below. Thx.