Proxy internet access trough SSH

In a scenario where one machine has access to the internet, and a remote machine does not (due to firewall restrictions), but is accessible via a VPN or something. There is a way to provide internet access for this remote machine. One way this can be achieved with dynamic port forwarding in SSH, at least …