Unable to connect: The remote connection failed or was closed unexpectedly
See original GitHub issueHi there, Firstly, thank you for such an awesome tool. I am having issues getting the Remote Connection working on the Amazon EC2 Windows Server 2019 instance.
I installed IIS with Web Sockets and I am trying to connect with the Administrator account itself. Able to connect RDP with Microsoft Remote Desktop but not with Myrtille.
This is the error I am getting:
I am using: Protocol: RDP, Security: AUTO, Server(;port): <Public IP of the AWS instance>:8431 Domain: Public DNS User: Administrator Password: <Password that I use to connect to RDP with MS Remote Desktop>
I checked the logs in Myrtille.Service, it shows:
2020-01-19 10:56:32,869 [45] INFO System.Diagnostics redirection [(null)] - Connecting remote session d5ae4ab9-2f5b-4a7a-b64f-c4b8b31526f2, type RDP, security RDP, server (:port)
13.232.225.245:8431, vm (none), domain ec2-13-232-225-245.ap-south-1.compute.amazonaws.com, user Administrator, program (none)
2020-01-19 10:56:49,227 [50] INFO System.Diagnostics redirection [(null)] - Disconnected remote session d5ae4ab9-2f5b-4a7a-b64f-c4b8b31526f2, exit code 131078
2020-01-19 10:59:34,054 [43] INFO System.Diagnostics redirection [(null)] - Connecting remote session 84891574-a4ec-4ebe-b936-f02327e1c2eb, type RDP, security AUTO, server (:port) 13.232.225.245:3389, vm (none), domain ec2-13-232-225-245.ap-south-1.compute.amazonaws.com, user Administrator, program (none)
2020-01-19 10:59:35,106 [43] INFO System.Diagnostics redirection [(null)] - Disconnected remote session 84891574-a4ec-4ebe-b936-f02327e1c2eb, exit code 131092
2020-01-19 10:59:53,135 [49] INFO System.Diagnostics redirection [(null)] - Connecting remote session 4abad21d-59a1-4718-a43a-b7b27882fe75, type RDP, security AUTO, server (:port) 13.232.225.245:3389, vm (none), domain (none), user Administrator, program (none)
2020-01-19 10:59:54,541 [49] INFO System.Diagnostics redirection [(null)] - Disconnected remote session 4abad21d-59a1-4718-a43a-b7b27882fe75, exit code 131092
2020-01-19 11:34:02,996 [49] INFO System.Diagnostics redirection [(null)] - Connecting remote session 12ed890d-651a-456f-abee-f84801c9bcdb, type RDP, security AUTO, server (:port) 13.232.225.245:8431, vm (none), domain ec2-13-232-225-245.ap-south-1.compute.amazonaws.com, user Administrator, program (none)
2020-01-19 11:34:19,781 [45] INFO System.Diagnostics redirection [(null)] - Disconnected remote session 12ed890d-651a-456f-abee-f84801c9bcdb, exit code 131078
I also checked the FreeRDP for the same Error Code 131078 (0x20006) but couldn’t get a proper solution. I have disabled NLA on Server too. I’ve tried keeping Stats ON and Debug ON, and this is what it shows:
Would be great if you can help.
Thanks, Manan
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Hi Cedric, Trying different combinations, finally it did work. Yes you’re right, problem with the port.
Now with Protocol RDP, Security Auto, Server and Domain as Public DNS and credentials it worked. (Also NLA had to be disabled).
If I change the Security to RDP or add the Port it doesn’t work. Guessing something wrong with my setup.
Thanks a lot for your help. Appreciate it.
Hi manan,
The freerdp exit code was different (131092) when you were using the standard rdp port 3389. It occurs with invalid credentials (https://github.com/cedrozor/myrtille/blob/3780cebf52d6109cc335064efde141fadbfbf079/Myrtille.Services.Contracts/Enums/RemoteSessionExitCode.cs#L39); assuming username and password are valid, did you try a nslookup on
ec2-13-232-225-245.ap-south-1.compute.amazonaws.com
from the myrtille machine ?Can you retry with port 3389, with another security protocol (i.e. TLS or RDP), after checking that NLA is not enforced on the target?