Yan, Try to provide an input stream to the process. I remember seeing a similar problem. /usr/bin/ssh -N -T -R 1022:localhost:22 u...@example.com -p 23 < /dev/null
See this post: http://stackoverflow.com/questions/19955260/what-is-dev-null-in-bash Regards, Fabrizio On Sun, Aug 7, 2016 at 8:03 AM, Yan Seiner <y...@seiner.com> wrote: > > > On 08/07/2016 07:29 AM, Yan Seiner wrote: > >> I have a remote node that I want to administer. I want to run an ssh >> tunnel from that node to my router. >> >> If I start it from the command line with >> >> /usr/bin/ssh -R 1022:localhost:22 u...@example.com -p 23 >> >> everything works fine. >> >> But if I try to run it from inittab or /etc/rc.local, it never connects. >> I've tried >> >> /usr/bin/ssh -N -T -R 1022:localhost:22 u...@example.com -p 23 >> /usr/bin/ssh -N -R 1022:localhost:22 u...@example.com -p 23 >> >> nothing seems to work. How do I run a tunnel automatically from an >> embedded box? >> > > To clarify this: > > The tunnel connects, tcpdump sees packets going back and forth, but > netstat on the local doesn't show the port. > >