0

I have a Linux server and a windows client. A folder is shared between these machines with read and write access for both of them.

I want to access a production database from my development machine, normally I do that using ssh port forwarding but in the environment which I'm facing, ssh port forwarding is not available but file sharing is.

Is there any way to forward a port from Linux server to my windows machine like ssh port forwarding but using file sharing? (I think it's theoretically possible but wondering is there any tool for that)

vidarlo
  • 6,654
  • 2
  • 18
  • 31
HamedH
  • 101
  • 2
  • This sounds *very* much like a [X-Y problem](https://xyproblem.info/). What end result do you want to achieve? – vidarlo Jul 23 '22 at 13:23
  • @vidarlo I want to access a production database from my development machine, normally I do that using ssh port forwarding but in the environment which I'm facing, ssh port forwarding is not available but file sharing is. – HamedH Jul 23 '22 at 13:31
  • One might in theory implement a TCP forwarder on top of file sharing. But I would expect the latency to be intolerable for practical use. – Steffen Ullrich Jul 23 '22 at 14:49
  • @SteffenUllrich But it's not a built in feature of SMB protocol... As [RFC1149](https://en.wikipedia.org/wiki/IP_over_Avian_Carriers) shows you can run TCP/IP over just about anything that can transport data. But it would require special software on either end. – vidarlo Jul 23 '22 at 21:32
  • @vidarlo: Exactly. It would be similar in concept to [IP over avian carriers](https://en.wikipedia.org/wiki/IP_over_Avian_Carriers), i.e. use something which is not really suitable as the underlying data layer and somehow make it work by implementing some kind of protocol translation on both client and server side. – Steffen Ullrich Jul 23 '22 at 21:35
  • @SteffenUllrich And it makes falcon security a nightmare. – vidarlo Jul 23 '22 at 22:12
  • Even considering you could make a tool on both sides for this (having to handle temporary files for a circular buffer representing network traffic between producer (packet emitter) and consumer (packet receiver) etc.), the actual resolution of the problem is human: you'll have to convince the relevant team: network/security/product owner that what you're trying to do: access production servers as a developer is legitimate and have them grant you such access within the normal available methods that will allow for proper auditing too. – A.B Jul 24 '22 at 18:21

1 Answers1

0

Is there any way to forward a port from Linux server to my windows machine like ssh port forwarding but using file sharing?

No, it's not possible. Forwarding traffic is part of the SSH protocol. It's not part of the CIFS/SMB protocol used by Windows' file sharing feature.

vidarlo
  • 6,654
  • 2
  • 18
  • 31