Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH client side port

I have a very basic question in mind. When using SSH for connecting to a server, we usually connect using port 22. The server receives requests from the client through this port. My question is when the client receives data from the server (e.g. list of files in a directory) what port is used on the client's side?

like image 981
redmoses Avatar asked Jun 23 '26 09:06

redmoses


1 Answers

There is only one connection that is bi-directional.

  • The port on the server side is 22 (the client needs a known port to connect to the server)
  • The port on the client side is dynamic/random, although it will stay the same for the entire SSH session.
like image 77
Joachim Isaksson Avatar answered Jun 26 '26 23:06

Joachim Isaksson