Ways to Gain Legitimate Remote Access through a Firewall
Gaining remote access through a firewall, when everything is configured properly, is a very easy task. When gaining remote access through a firewall, you are connecting with a certain application, such as a remote desktop.
This application uses a specified port to accept connections and you need to know the port on which on the application is running. If you don't know the port, ask the administrator of the other machine to tell you the port.
Alternatively, you can also try some default ports because many applications have such default ports and can't be run on another port. Search the Internet and see which ports are typically used by the application you are trying to access.
In theory, port scanning is also an option to learn the port where the application of interest to you is running but if you do it, it can be interpreted as a hacking attempt and this could have some negative consequences for you. Port scanning is used when you need to detect a firewall but since you already know there is a firewall, it is pointless to scan ports.
If you know the port but you still can't connect, this most likely means that either the port is blocked, or you are blocked from accessing it. If the port is blocked, ask the other party to open the port. It is safest if they open it just for you (i.e. your IP, or an authenticated user). If you are blocked from accessing the port, which is not very probable, unless you did something bad, ask to be removed from the blacklist.
In many cases you can't gain remote access through a firewall simply because you are providing the wrong credentials. Just check if you are entering the right credentials and this is it.