Can you be a little more specific on what you are trying to accomplish?

Are you just trying to have access to files?

Kind of. I want to be able to update packages on remote servers that sit behind hardware firewalls that don't allow any outbound traffic.

While it's no problem downloading individual package files over ssh and updating that way, it's a lot of work getting all the dependencies and all the packages transferred and installed in the right order. So I want to let the package manager on the remote servers (apt in this case) access the software repositories on the local LAN (of the ssh client) over the ssh connection.

That is the local tcp forwarding. I knew that could be done but in this case it's the opposite direction I need, the remote tcp forwarding. It's like putting internet and the proxy on Computer B instead.

That is the local tcp forwarding. I knew that could be done but in this case it's the opposite direction I need, the remote tcp forwarding. It's like putting internet and the proxy on Computer B instead.

I think I have it figured out though. Just need to try it on a couple of test VMs first.

That is the local tcp forwarding. I knew that could be done but in this case it's the opposite direction I need, the remote tcp forwarding. It's like putting internet and the proxy on Computer B instead.

I wanted the remote server to have access to a local repository served over http. This works with any kind of traffic over tcp though, as it's not a web proxy but tcp forwarding.

I set up the files and served the website on the ssh client machine with PHPs build-in server. It's easy to use and requires no setup. You just start it in the base directory you want to serve. I used port 8000.

php -S localhost:8000

Then access the remove server from the client with the reverse tcp forwarding active.
Basically forwarding port 8000 on the remote host to port 8000 on the local ssh client.

ssh -R 8000:localhost:8000 remote_ip

But since I was connecting with a windows machine I used putty instead.
This is how you set up the tcp forwarding:

It seems like you can not only forward one port, but many ports and in whatever direction you want at the same time.

To try that you have things working:

wget localhost:8000

In my case I wanted apt package manager to use the forwarded port so I just changed it to use http://localhost:8000 to access the packages.

I wanted the remote server to have access to a local repository served over http. This works with any kind of traffic over tcp though, as it's not a web proxy but tcp forwarding.

I set up the files and served the website on the ssh client machine with PHPs build-in server. It's easy to use and requires no setup. You just start it in the base directory you want to serve. I used port 8000.

php -S localhost:8000

Then access the remove server from the client with the reverse tcp forwarding active.
Basically forwarding port 8000 on the remote host to port 8000 on the local ssh client.

ssh -R 8000:localhost:8000 remote_ip

But since I was connecting with a windows machine I used putty instead.
This is how you set up the tcp forwarding:

It seems like you can not only forward one port, but many ports and in whatever direction you want at the same time.

To try that you have things working:

wget localhost:8000

In my case I wanted apt package manager to use the forwarded port so I just changed it to use http://localhost:8000 to access the packages.

Right you can name any number of ports. If you want to do dynamic tunneling you can pass a -D and use the remote host as a SOCKS proxy. Then only define the one port for the proxy in your browser or wherever.