Files
UnrealEngineUWP/Engine/Build/BatchFiles/MakeAndInstallSSHKey.bat
Josh Adams 503b823e5f - Massive SSH usability improvements for remote compiling. Added a script to interactively run SSH and RSync to make a key on the Mac, install it, and pull down the private key for use after
- Currently only UBT will do the check when using SSH, and will run the script. This should really be moved to the editor.
- Keys can be in My Documents, or in Engine\\Build (for source control sharing)
- SSH is still not 100% ready for primetime (IPP needs re-integration into UAT)
- Epic default is to use the standard builder account on the standard machine

[CL 2229159 by Josh Adams in Main branch]
2014-07-23 20:02:14 -04:00

61 lines
2.4 KiB
Batchfile

@echo off
setlocal
set SSH=%1
set SSHDIR=%~d1%~p1
set RSYNC=%2
set USER=%3
set MACHINE=%4
set DOCUMENTS=%5
set CYGWIN_DOCUMENTS=%6
set ENGINE=%~7
set KEY_DIR=%DOCUMENTS%\Unreal Engine\UnrealBuildTool\SSHKeys\%MACHINE%\%USER%
set KEY_PATH=%DOCUMENTS%\Unreal Engine\UnrealBuildTool\SSHKeys\%MACHINE%\%USER%\RemoteToolChainPrivate.key
set CYGWIN_KEY_PATH=%CYGWIN_DOCUMENTS%/Unreal Engine/UnrealBuildTool/SSHKeys/%MACHINE%/%USER%/RemoteToolChainPrivate.key
echo %SSHDIR%
echo.
echo ================================================================================
echo Connecting to %MACHINE% as user %USER% to create an SSH Key.
echo.
echo Please note the following:
echo It may prompt you about "authenticity of host can't be established." You must enter yes
echo It will then prompt your for your password on %MACHINE%
echo Finally it will ask your for a 'passphrase' for your new SSH key. Do NOT give it a passcode, just hit enter
echo Hit enter again when prompted to confirm.
echo ================================================================================
echo.
pause
%SSH% %USER%@%MACHINE% "if [[ ! -e .ssh ]]; then mkdir .ssh; fi && cd .ssh && if [[ -e authorized_keys ]]; then cp -f authorized_keys authorized_keys_UEBackup; fi && ssh-keygen -t rsa -f RemoteToolChain && mv -f RemoteToolChain.pub RemoteToolChainPublic.key && mv -f RemoteToolChain RemoteToolChainPrivate.key && cat RemoteToolChainPublic.key >> authorized_keys";
echo.
echo ================================================================================
echo Now we will connect again to %MACHINE% to download the generated private key.
echo You will have to enter your password again.
echo The private key will be stored in:
echo %KEY_PATH%
echo.
echo If you want to share this key with others on your team, copy the contents of SSHKeys directory to:
echo %ENGINE%\Build\SSHKeys
echo and then put it into your source control.
echo ================================================================================
echo.
pause
mkdir "%KEY_DIR%" 2> NUL
pushd %SSHDIR%
%RSYNC% -za %USER%@%MACHINE%:.ssh/RemoteToolChainPrivate.key "%CYGWIN_KEY_PATH%"
popd
echo.
echo ===================================================================================================
echo Assuming you have seen no errors above, you are ready to compile UE4 remotely on %MACHINE%!
echo ===================================================================================================
echo.
pause