arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passwordless login to VPS
#1
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.
[Image: K_pkiv_g_s001_www.kepfeltoltes.hu_.jpg]

2. You can change "number of bits in a generated key" to "4096" if you would like to be more secure.
[Image: K_pkiv_g_s002_www.kepfeltoltes.hu_.png]

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:
pwd
To check where you are, you must be in your home directory
cd ~
If you are not in home, then you must go there
mkdir .ssh
To create a new .ssh directory
nano .ssh/authorized_keys
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
chmod -R 700 .ssh/

9. Open and edit sshd_config file
nano /etc/ssh/sshd_config
Search the PermitRootLogin line.
Delete "Yes" or "No" and replace with "without-password".
PermitRootLogin without-password
Save changes and exit from nano.

9. Restart your VPS
reboot

10. Locate your private key in Putty
[Image: 816138115K_pkiv_g_sputtysaveprivatekey00...es.hu_.png]
/Connection/SSH/Auth/Browse

11. Save connection in Putty and Connect
[Image: K_pkiv_g_sputtyconnect004_www.kepfeltoltes.hu_.png]
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 [Image: thumbsup.png] button below. Thx.


Messages In This Thread
Passwordless login to VPS - by Dudi - 10-21-2015, 04:45 PM
RE: Passwordless login to VPS - by xdude - 10-21-2015, 05:06 PM
RE: Passwordless login to VPS - by Dudi - 10-22-2015, 05:18 AM
RE: Passwordless login to VPS - by Conan - 10-24-2015, 05:49 PM
RE: Passwordless login to VPS - by Sagnik - 10-25-2015, 05:33 AM

Possibly Related Threads…
Thread
Author
Replies
Views
Last Post

person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting