Adriana Rodean
2008-Dec-12 10:19 UTC
Can't connect client when runned from Windows Service
Hi, I have a client on a Windows machine that connects through openssh on a linux server. I have this script (tunnel.cmd): @echo off :RUN echo Connecting? "C:/Program Files/OpenSSH/bin/ssh.exe" -R 40201:localhost:50300 -o TCPKeepAlive=no -o ServerAliveInterval=15 -o ServerAliveCountMax=2 -i id_rsa visma at 10.55.40.123 echo Restarting in 10 seconds? GOTO RUN It is runned from another application that starts as windows service. When i run the same script manually it makes the connection to linux machine. Is not working when we run it from the application that starts as windows service. Any help greatly appreciated. Thanks in advance, Adriana
On 12.12.2008 13:19, Adriana Rodean wrote:> Hi, > > I have a client on a Windows machine that connects through openssh on a > linux server. > I have this script (tunnel.cmd): > > @echo off > :RUN echo Connecting? > "C:/Program Files/OpenSSH/bin/ssh.exe" -R 40201:localhost:50300 -o > TCPKeepAlive=no -o ServerAliveInterval=15 -o ServerAliveCountMax=2 -i id_rsa > visma at 10.55.40.123 > echo Restarting in 10 seconds? > GOTO RUN > > It is runned from another application that starts as windows service. > When i run the same script manually it makes the connection to linux > machine. Is not working when we run it from the application that starts as > windows service. >'-ddd' ssh command line parameter and output redirection will help you. -- Sincerely Your, Dan.
Adriana Rodean
2008-Dec-13 20:27 UTC
Can't connect client when runned from Windows Service
Thanks for the advice Dan, will try it. Script makes the connection if is started manually from command line, or if program is started as executable. But when i start it as windows service i see it running in task manger (cmd.exe and ssh.exe) but it doesn't make the tunnel with the server. I've tried different user accounts to make it connect as service. Only one that could connect is if is runned under the user that is logged on, but that means user has to input username and password. Is it a way to make connection if is runned as Local service or Network Service or Local System? Thanks in advance, Adriana
Adriana Rodean
2008-Dec-13 20:42 UTC
Can't connect client when runned from Windows Service
Also, what does '-ddd' do? Looked on manual and only thing i could find is *-D* [*bind_address*:]*port* Specifies a local ``dynamic'' application-level port forwarding. Googled it also but didn't find anything about it Thanks again, Adriana
Adriana Rodean wrote:> "C:/Program Files/OpenSSH/bin/ssh.exe" -R 40201:localhost:50300 -o > TCPKeepAlive=no -o ServerAliveInterval=15 -o ServerAliveCountMax=2 -i id_rsa > visma at 10.55.40.123..> When i run the same script manually it makes the connection to > linux machine. Is not working when we run it from the application > that starts as windows service.First of all, always supply the full path for the id_rsa file so that the file is found regardless of the current working directory. Second, run ssh with -N and -T. Check out the ssh(1) man page to learn more about their meaning. -T is important for all automated runs. //Peter