Skip to content

Instantly share code, notes, and snippets.

@zeroxia
Last active December 27, 2015 05:39
Show Gist options
  • Save zeroxia/7276270 to your computer and use it in GitHub Desktop.
Save zeroxia/7276270 to your computer and use it in GitHub Desktop.
To enable ssh hop with key forwarding, doing the following two things is not enough: 1. PuTTY session configuration, enable "Allow agent forwarding" under "Connection --> SSH -> Auth"; 2. Start the PAGEANT.exe utility program. There is a third important step: Load your private key (.ppk format by PuTTY) into the PAGEANT agent manager. The follow…
@ECHO OFF
if not "%~1" == "" (
set PPK_FILE=%~1
) else (
set PPK_FILE=kanna.ppk
)
if not exist %PPK_FILE% (
REM Assume the PPK file is located aloneside PAGEANT.exe
start "" %~dp0PAGEANT.exe "%~dp0%PPK_FILE%"
) else (
start "" %~dp0PAGEANT.exe "%PPK_FILE%"
)
REM ==========================
REM OR JUST USE THIS ONE LINER
REM Just put the batch file,
REM ppk file to the same folder
REM of PAGEANT.exe
REM ==========================
start "" %~dp0PAGEANT.exe "%~dp0MY.ppk"
@zeroxia
Copy link
Author

zeroxia commented Nov 2, 2013

Reference:
http://www.howtogeek.com/125364/how-to-ssh-hop-with-key-forwarding-from-windows/

Turns out the description session atop is not processed as Github-flavored-markdown, and even the newlines are not reserved. So I paste it here for prettier look:

To enable ssh hop with key forwarding, doing the following two things is not enough:

  1. PuTTY session configuration, enable "Allow agent forwarding" under "Connection --> SSH -> Auth";
  2. Start the PAGEANT.exe utility program.

There is a third important step:
Load your private key (.ppk format by PuTTY) into the PAGEANT agent manager.

The following is a simple BAT file for simplifying this "start PAGEANT and load the PPK file" step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment