Last active
December 27, 2015 05:39
-
-
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…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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%" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
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.