From d78f3a8e0aa7daf5606687512dd8d630e88308a6 Mon Sep 17 00:00:00 2001 From: GaryLBaird Date: Thu, 20 Jul 2017 21:57:13 -0600 Subject: [PATCH] Made corrections to -I configuration on SSHI and added a default _UserName_ var to the alias default alias.cmd file. --- CLHelper.bat | 8 ++++---- scripts/cmd/alias.cmd | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CLHelper.bat b/CLHelper.bat index 546ffe2..5b3a903 100644 --- a/CLHelper.bat +++ b/CLHelper.bat @@ -323,7 +323,7 @@ SET LocalFile=%USERPROFILE%\.ssh\authorized_keys SET SSHDIR=/home/%USE_THIS_USER%/.ssh FOR /D %%i in (!__MACHINES__!) do ( ECHO connecting to server - %CommandLineHelper%\bin\OpenSSH\bin\ssh.exe %USE_THIS_USER%@%%i -i %USERPROFILE%\.ssh\id_rsa + %CommandLineHelper%\bin\OpenSSH\bin\ssh.exe %USE_THIS_USER%@%%i -I %USERPROFILE%\.ssh\id_rsa ) ENDLOCAL :LinuxDone @@ -374,7 +374,7 @@ REM REM Begin Test Connections Script FOR /D %%i in (!__MACHINES__!) do ( ECHO. ECHO Attempting to connect to %%i and validate it is working properly. - %CommandLineHelper%\bin\OpenSSH\bin\ssh.exe !USE_THIS_USER!@%%i -i %USERPROFILE%\.ssh\id_rsa + %CommandLineHelper%\bin\OpenSSH\bin\ssh.exe !USE_THIS_USER!@%%i -I %USERPROFILE%\.ssh\id_rsa ) ENDLOCAL :LinuxDoneSetupSSH @@ -897,7 +897,7 @@ SETLOCAL ENABLEDELAYEDEXPANSION FOR /D %%A IN (%__GOSERVER__%) DO ( ECHO._________________________________________________________________________________ ECHO Connecting to Linux Server: %%A.%_MyDomainOrWorkgroup_% - IF NOT DEFINED _DEBUG_ START ssh gary@%%A.%_MyDomainOrWorkgroup_% -i %userprofile%\.ssh\id_rsa + IF NOT DEFINED _DEBUG_ START ssh %_MyUserName_%@%%A.%_MyDomainOrWorkgroup_% -I %userprofile%\.ssh\id_rsa ECHO._________________________________________________________________________________ ) ENDLOCAL @@ -908,7 +908,7 @@ SETLOCAL ENABLEDELAYEDEXPANSION FOR /D %%A IN (%__LINUX_SERVERS__%) DO ( ECHO._________________________________________________________________________________ ECHO Connecting to Linux Server: %%A.%_MyDomainOrWorkgroup_% - IF NOT DEFINED _DEBUG_ START ssh %_MyUserName_%@%%A.%_MyDomainOrWorkgroup_% -i %userprofile%\.ssh\id_rsa + IF NOT DEFINED _DEBUG_ START ssh %_MyUserName_%@%%A.%_MyDomainOrWorkgroup_% -I %userprofile%\.ssh\id_rsa ECHO._________________________________________________________________________________ ) ENDLOCAL diff --git a/scripts/cmd/alias.cmd b/scripts/cmd/alias.cmd index b61c6aa..84fd94d 100644 --- a/scripts/cmd/alias.cmd +++ b/scripts/cmd/alias.cmd @@ -10,6 +10,7 @@ SET _CLHScripts_=c:\CommandLineHelper\Scripts SET _CLHBIN_=c:\CommandLineHelper\bin SET _READWRITEINI_=%_CLHScripts_%\vbs\readwriteini.vbs SET CLHelper=%_CLHScripts_%\CLHelper.bat +SET _USERNAME_=%username% ::Create Default Directories IF NOT EXIST "%_CLHScripts_%\vbs" ( @@ -75,7 +76,7 @@ DOSKEY ls=%CLHelper% --ls $* DOSKEY vjson=%CLHelper% --JsonCheck $* DOSKEY rdp=%CLHelper% --RDP $* DOSKEY window=%CLHelper% --mode $* -DOSKEY sshi=%_CLHBIN_%\OpenSSH\bin\ssh.exe %_USERNAME_%@$1 -i %USERPROFILE%\.ssh\id_rsa +DOSKEY sshi=%_CLHBIN_%\OpenSSH\bin\ssh.exe %_USERNAME_%@$1 -I %USERPROFILE%\.ssh\id_rsa ::Custom Alias Directory SET _CustomAliasDir_=C:\dev\scripts ::Custom Alias Create If Missing