diff --git a/server/scripts/restore_ssh_access.cmd b/server/scripts/restore_ssh_access.cmd index 58d901e..63670a2 100644 --- a/server/scripts/restore_ssh_access.cmd +++ b/server/scripts/restore_ssh_access.cmd @@ -14,9 +14,8 @@ if not exist C:\Users\Administrator\.ssh mkdir C:\Users\Administrator\.ssh REM The user owns their .ssh, so that they can add keys of their own. for /f "tokens=5" %%i in ('findstr /b "root:" C:\msys2\etc\passwd') do set SID=%%i set SID=!SID:*,=! -if defined SID ( - icacls C:\msys2\home\root\.ssh /grant *!SID!:(OI)(CI)F /t - icacls C:\msys2\home\root\.ssh /setowner *!SID! -) - +if not defined SID goto :done +icacls C:\msys2\home\root\.ssh /grant *!SID!:(OI)(CI)F /t +icacls C:\msys2\home\root\.ssh /setowner *!SID! +:done echo The SSH access is back.