Secure Shell
Dynamically allocated port on reverse forward Aug 16 2010 10:19PM
Joke de Buhr (joke seiken de) (1 replies)
Re: Dynamically allocated port on reverse forward Aug 17 2010 04:59AM
ADFHAU (openssh bachelorguy com) (1 replies)
Hi,

> If I invoke ssh this way:
> ssh -R 0:localhost:22 remote_ssh_server
> ssh prints a debug message like:
> Allocated port 40454 for remote forward ....
> before it drops to the shell.
>
> Is there a way of querying the allocated port on the remote site to
> make it usable within scripts? For example to execute a command via
> ssh on the origin site in this case.

If you could determine the ancestry of the script process, back to the
sshd driving it and then look up the pid in lsof or netstat output,
you could probably do it.

That or if the script had access to logs and the logging level were
high enough.

[ reply ]
Re: Dynamically allocated port on reverse forward Aug 17 2010 06:02PM
Joke de Buhr (joke seiken de) (1 replies)
RE: Dynamically allocated port on reverse forward Aug 17 2010 07:49PM
Males, Jess (jmales cio sc gov) (1 replies)
Re: Dynamically allocated port on reverse forward Aug 17 2010 08:57PM
Joke de Buhr (joke seiken de)


 

Privacy Statement
Copyright 2010, SecurityFocus