SSH without Password (Win to Linux) - pavangayakwad/scripts GitHub Wiki

On windows, get into an empty folder and run this command

ssh-keygen -t rsa -b 4096 -C "[email protected]"

It asks for filename, give it any. and the password, leave it empty

It generates 2 files, (1) private (file with no extension) (2) public with .pub extension

Log-in to linux machine,

  • go to your user .ssh folder
  • nano authorized_keys
  • copy content from .pub file in windows to authorized_keys file, save and close nano
  • chmod 600 authorized_keys
  • chmod 700 .ssh

Back to windows,

  • go to path C:\Users\pavan\.ssh
  • create folder id_rsa and copy 2 files created with ssh-keygen
  • open C:\Users\pavan\.ssh\config in text editor add the following section
Host 192.168.1.23
  HostName 192.168.1.23
  User pavan
  IdentityFile C:\Users\pavan\.ssh\id_rsa\<private-key-filename-with-no-extn>
  IdentitiesOnly yes

Now ssh pavan@ip_address to your local LAN server and it should not ask you the password!