Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I reuse an ssh connection on windows? Ive been using these settings in my _vimrc for sftp and noticed that each time I browse or try to edit a file with netrw, a new connection is created which takes an awful long time.

let g:netrw_cygwin = 0
let g:netrw_ssh_cmd  = '"C:\Program Files\PuTTY\plink.exe" -batch -T -ssh'
let g:netrw_scp_cmd  = '"C:\Program Files\PuTTY\pscp.exe"  -batch -q -scp'
let g:netrw_sftp_cmd = '"C:\Program Files\PuTTY\pscp.exe"  -batch -q -sftp'
let g:netrw_list_cmd = '"C:\Program Files\PuTTY\plink.exe" myuser@mysite.com ls -Fa '

I have also tried to use cyg-wrapper.sh to avoid this problem

:e scp://myuser@mysite.com:22//home

but a cmd window opens up with this error

/bin/bash -c "/usr/bin/scp -q -P 22 "myuser@mysite
.com:/home" "C:\cygwin\tmp\VIA3996.tmp""
The system cannot find the path specified.
shell returned 1
Hit any key to close this window...

I tried scp because I didnt know how to use a private key for sftp at the time within cygwin

share|improve this question

1 Answer 1

According to keeping ssh connections open on windows, PuTTY doesn't support connection sharing. So, try using one of the mentioned OpenSSH ports instead with the configuration mentioned in the question.

share|improve this answer
    
apparently, cygwin does not support connection sharing cygwin.com/ml/cygwin/2012-02/msg00366.html which OpenSSh_for_windows also uses –  wiel Oct 5 '13 at 18:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.