Skip to content

Oueta

/* Nifty tech journal */

  • Home
  • MAC address lookup
  • PCI database lookup
  • Unix time converter
  • My IP Address
  • Linux Commands Cheat Sheet

Tag: Putty

Putty

Posted on August 12, 2017January 6, 2018 by oueta

SSH auto login with Putty from Windows

Putty it’s the best SSH client for Microsoft Windows out there, it’s free, it’s open source and supports many protocols, for productivity reasons sometimes we need to auto login.

Local host: Microsoft Windows
Remote host: Linux or Unix with OpenSSH Server
Download Putty  https://www.chiark.greenend.org.uk/~sgtatham/putty/docs.html

Method 1

Fast, not recommended for security reasons, password will be stored in plain text.
1. Create a shortcut for putty.exe
2. Select the properties for the created shortcut and add to the “Target” text box:

-ssh my_user@remote_host -pw my_password
SSH auto login with putty, shortcut with arguments
SSH auto login with putty, shortcut with arguments

Method 2

Public and private key pair method, this is recommended.
1. Download and open puttygen.exe from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
a.) Generate the keys, click “Generate” and move the mouse over the blank are
b.) Save the keys, click “Save public key” and “Save private key” (without a passphrase)
c.) Copy the public key from “Public key for pasting into OpenSSH authorized_keys file” text box.

PuttyGen, generate public and private key
PuttyGen, generate public and private key

2. Login into the remote host with the user used for auto login
a.) Create .ssh directory in the home folder and set permission.

mkdir ~/.ssh
chmod 700 ~/.ssh

b.) Edit ~/.ssh/authorized_keys, paste the public key from PuTTy Key Generator (see 1/c) and set permission.

nano ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

3. Open Putty
Create a new session with the following information.
Putty > Session > Host Name ( or IP address ): remote_host
Putty > Session > Saved Sessions: remote_host
Putty > Connection > Data > Auto-login username: my_user
Putty > Connection > Data > SSH > Auth > Private key file for authentication: click browse and select the private key
Putty > Session > Save

You are ready! Open Putty and load the saved session, auto login should work!

4. ( Optional ) Create a shortcut for putty, go to properties and add -load remote_host (session name) to the “Target” text box.

Posts navigation

Previous page Page 1 Page 2

Categories

  • Cross Platform
  • Linux
  • macOS
  • Microsoft
  • Networking
  • Unix
  • VirtualBox
  • Windows Driver
  • Windows Third Party
  • Windows Tweak
  • Wordpress

Recent Posts

  • Installing Arch Linux on a Macbook or other UEFI systems
  • Change docker0 IP Address in Linux
  • Using the ps command in Linux
  • Install vsftpd on Debian 9
  • How to change the hostname in macOS
  • Using ssh-agent for auto login with public keys in Linux
  • How to display CPU Information in Linux
  • How to connect to a Wi-Fi network via command line in Linux
  • How to generate self signed certificates for Apache2
  • How to install a LAMP server on Debian and Ubuntu
Free typing test
  • Facebook
  • Twitter
  • Google+
  • Email
Privacy Policy Proudly powered by WordPress
  • About
  • Privacy Policy
  • Terms and Conditions