Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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
    
apparently Putty does in version 0.66 and possibly before, since I came here looking for info on the PuTTY message "Reusing a shared connection to this server" – user9999999 Mar 29 at 22:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .