Sign up ×

My Ubuntu runs ssh on port 22. But my /var/log/auth.log says different port numbers when connections are made. And the port numbers are seemingly random:

Connection from port 33692
Connection from port 32970

Why are these port numbers not 22? And is there a pattern behind which port numbers are picked?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

That's the remote port, not the local port. The remote OS picks a random number in a high range for the SSH client to bind to, then the client connects to port 22 on the server.

share|improve this answer
Are there any resources out there that explain in more detail how this works? –  David Xia Feb 19 '12 at 9:44

Your Answer


