Chmodding RemoteToolChainPrivate.key for iOS remote builds

I am encountering an error when trying to use the iOS remote build feature. I believe I have everything setup correctly EXCEPT the permissions on the private key that Unreal generated.

Here is the error:

@ WARNING: UNPROTECTED PRIVATE KEY FILE! @

Permissions 0660 for '/cygdrive/C/Users/<username>/AppData/Roaming/Unreal Engine/UnrealBuildTool/SSHKeys/<ip>/<username>/RemoteToolChainPrivate.key' are too open.

It is recommended that your private key files are NOT accessible by others. This private key will be ignored.

Which is an easy enough error to fix on a Unix system, but I just can’t seem to get them set correctly on windows. Here are some things I have tried:

  • running chmod.exe from Engine\Extras\ThirdPartyNotUE\DeltaCopy\Binaries (which is near as i can tell where ssh gets run from)
  • using the linux subsystem for windows 10 and chmod
  • using cygwyn and chmod
  • adjusting permissions using the windows permissions dialog

Does anyone actually have this working?

Hello,

I’ve had the same issue as well and it took ages to figure it out, I was using Unreal Engine 4.18 though. To fix the ‘Permissions 0660’ error, I followed the instructions on this post: How to launch Code Project to iOS on Windows? 4.13 - Mobile - Epic Developer Community Forums

Specifically the commands:

chgrp.exe Users /cygdrive/C/Users/nicho/AppData/Roaming/Unreal\ Engine/UnrealBuildTool/SSHKeys/nicky/nick/RemoteToolChainPrivate.key
chmod.exe 600 /cygdrive/C/Users/nicho/AppData/Roaming/Unreal\ Engine/UnrealBuildTool/SSHKeys/nicky/nick/RemoteToolChainPrivate.key

Replacing the directory with your own directory above.

After solving this error I had another one though which I could not figure out:

LogPlayLevel: UnrealBuildTool: Warning: Identity file /cygdrive/C/Users/myUser/AppData/Roaming/Unreal Engine/UnrealBuildTool/SSHKeys/192.168.1.xx/myUser/RemoteToolChainPrivate.key not accessible: No such file or directory

This was happening for me because the RemoteBuildTool is set-up to look for the first ssh.exe it finds and then tries to load the cygwin path. If that ssh.exe it finds is a windows native version like in my case, it will run it with the cygwin path which is not a valid windows path and it will fail. To check which ssh.exe is used you can open a terminal and type:

where ssh

In my case it was returning:
C:\Program Files\Git\usr\bin\ssh.exe
which is a windows native version. I navigated to that file and changed ‘ssh.exe’ to something else like ‘ssh-1.exe’ and it worked (If you run ‘where ssh’ on a terminal now it should tell you that it can’t find the file). Of course now every time I need to use git I have to change it back to ‘ssh.exe’, so it is not the best solution, but a working solution nonetheless, as I could not find anything else on the forums after hours of trying.

I hope this helped you, let me know!

This was very helpful, especially the ssh problem which had me stumped. Thank you!

If rsync issue that can’t find ssh.exe is still bothering you and you have a source engine, you can apply changes from this commit and rebuild UnrealBuildTool and iPhonePackager :

https://github.com/EpicGames/UnrealEngine/pull/3166/commits/3ab2ab6cebd701e051a70a4f92d278494701e737

After these changes it should work like a charm :wink:

After doing the first part, I get a new error:
UATHelper: Packaging (iOS): ERROR: Unable to determine home directory for remote user. SSH output:
UATHelper: Packaging (iOS): Permission denied (publickey,password,keyboard-interactive).
PackagingResults: Error: Unable to determine home directory for remote user. SSH output:
UATHelper: Packaging (iOS): Took 0.5824751s to run UnrealBuildTool.exe, ExitCode=5
UATHelper: Packaging (iOS): UnrealBuildTool failed. See log for more details. (C:\Users\kev_2\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.24\UBT-MyProject7-IOS-Development.txt)
UATHelper: Packaging (iOS): AutomationTool exiting with ExitCode=5 (5)
UATHelper: Packaging (iOS): BUILD FAILED

any help on that? I go to the key and change permissions, then I get the 0660 error again, then I run the cygwin code again, then I get that error again :frowning:

I encounter this issue right now and cant build per remote.
Is the method above still the best method to that date?
Maybe other people had issues with it in the last time?

Many thanks guys

Many of these answers are needed to solve the problem, however what I found is additionally needed with 4.24 is the following:

  1. Make sure your username on the mac is the same as your username on windows
  2. Add the line “StrictModes no” to your sshd_config file on Mac
  3. Run the editor as ADMINISTRATOR.

I think point #3 is the most important.

1 Like

see my post below.

changing StrictMode value is the key here: it allows bypassing permission check for the private keyfile, which is fine if you work on a private, firewalled internal network.