Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] get free local port for script?
- Date: Sat, 17 Mar 2007 23:29:10 +0900
- From: Edward Wright <edw@example.com>
- Subject: Re: [tlug] get free local port for script?
- References: <20070317120851.GL13829@example.com> <17915.62317.493373.158055@example.com>
- User-agent: Mutt/1.4i
On Sat, Mar 17, 2007 at 10:55:57PM +0900, Stephen J. Turnbull wrote: > Edward Wright writes: > > > I'd like to programmatically access a remote service over an ssh tunnel. > > I need a free local port to use, and I'm wondering the best way to get > > one. > > I don't understand. Some will be listening on port P only if you put > it there. What's wrong with: Pick a port, grep for it in > /etc/services, and if you discover that it's either not there or is > registered only to services you'll never use, use it? My understanding is that when you make a (in this case) tcp connection to a remote host, a port is assigned on the local host in some sequence order.... therefore, I would think that at any given time, any given port could be in use. Am I missing something? Ed
- Follow-Ups:
- Re: [tlug] get free local port for script?
- From: Stephen J. Turnbull
- References:
- [tlug] get free local port for script?
- From: Edward Wright
- [tlug] get free local port for script?
- From: Stephen J. Turnbull
Home | Main Index | Thread Index
- Prev by Date: [tlug] get free local port for script?
- Next by Date: Re: [tlug] Adding text to the beginning of a file
- Previous by thread: [tlug] get free local port for script?
- Next by thread: Re: [tlug] get free local port for script?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links