Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I suddenly came across the term "ephemeral port" in a Linux article that I was reading, but the author did not mention what it is.

What is an ephemeral port in UNIX?

share|improve this question
up vote 7 down vote accepted

In essence an ephemeral port is a random high port used to communicate with a known server port. For example, if I ssh from my machine to a server the connection would look like: --->

22 is the standard SSH port I'm connecting to on the remote machine; 37852 is the ephemeral port used on my local machine

share|improve this answer
So in this case , 37852 is the ephemeral port ? – The Dark Knight Feb 20 '13 at 14:18
you are correct – h3rrmiller Feb 20 '13 at 14:19
@h3rrmiller, "Ephemeral port" is a concept that has nothing to do with UNIX right? – Pacerier Mar 29 '15 at 4:28
Correct. An ephemeral port is a random high port the client software (regardless of operating system) picks to communicate to a known service port. – h3rrmiller Jun 1 '15 at 19:11

Quoting from Wikipedia:

An ephemeral port is a short-lived transport protocol port for Internet Protocol (IP) communications allocated automatically from a predefined range by the TCP/IP software. It is used by the Transmission Control Protocol (TCP), User Datagram Protocol (UDP), or the Stream Control Transmission Protocol (SCTP) as the port assignment for the client end of a client–server communication to a well known port on a server.

The best example I know is FTP. And it's not a Unix-bound concept.

share|improve this answer
"FTP" isn't exactly an example of an ephemeral port – Michael Mrozek Feb 20 '13 at 15:13
Not what I meant, I meant it's a protocol that uses the concept. – schaiba Feb 20 '13 at 16:09
by default *nix systems all use the ephemeral concept. come to think of it windows does too. except each flavor of *nix has a slightly varying range. different windows versions use different ranges too. – h3rrmiller Feb 20 '13 at 17:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.