Hi, Tried with instsrv.exe and srvany.exe, still same problem. Only way it connects as windows service is if started as user account. I am thinking that it allows to connect with user account because the known_hosts file was previous created. As soon as i deleted that file ssh asked if i am sure to connect to the linux machine because is not known. If i answered yes known_hosts file was created in c:\documents and settings\[user]\.ssh folder. If i copyed the .ssh folder in c:\documents and settings\NetworkService folder still didn't work. My cmd file is: @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@xxxxxxxxxxxx echo Restarting in 10 seconds… GOTO RUN Tried like this also: "C:/Program Files/OpenSSH/bin/ssh.exe" -R 40201:localhost:50300 -o TCPKeepAlive=no -o ServerAliveInterval=15 -o ServerAliveCountMax=2 -T -N -i "C:/id_rsa" visma@xxxxxxxxxxxx still doesn't connect when started as service. Is it a way to make ssh not ask that first question (we can't input yes from service)? or make it recognize the known_hosts file? And is it a way to output the verbose to a file? I'm using OpenSSH for Windows 3.8p1-1 20040709 Build Thanks, Adriana On Sun, Dec 14, 2008 at 13:45, Morgan Reed <morgan.s.reed@xxxxxxxxx> wrote: > On Sat, Dec 13, 2008 at 6:49 AM, Adriana Rodean <adrya1984@xxxxxxxxx> wrote: >> I have a script (cmd file) that creates a openssh tunnel between a >> windows machine with a linux machine. Is started from another program >> that runs as a windows service. > > Some acrobatics with srvany.exe instsrv.exe (they're both microsoft > resource kit tools) and key-based authentication (or a key agent) > should do it for you. > > For details on instsrv.exe and srvany.exe see this KB article; > <http://support.microsoft.com/kb/137890> >