
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tlug] get free local port for script?
- Date: Sat, 17 Mar 2007 21:08:51 +0900
- From: Edward Wright <edw@example.com>
- Subject: [tlug] get free local port for script?
- User-agent: Mutt/1.4i
Hi,
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 can think of kludgy things like grepping thru the output of
netstat to see if some port is in use, but it seems like there should
be a cleaner way. Ideally, something like
ssh -L `getfreeport`:remotehost:remoteport......
where "getfreeport" would be my ideal function. My reference books and
google don't yield anything interesting. Ideas?
Thanks,
Ed
Home |
Main Index |
Thread Index