I wish to use netrw :Explore on a remote server via ssh tunnelling, but can't manage to do it.

I can access the server perfectly fine using ssh and remotely edit files with vim:

vim scp://userid@hostname//path/to/filename

works fine for me. However when I try to work with directory the userid / hostname seems to go completely wrong:

vim scp://userid@hostname//path/to/directory/

is interpreted as @userid@hostname (not the usual scp -q 'userid@hostname:/path/to/file' I usually get with a file), so I get a permission denied (publickey,password).

What should I do to get access to the directory (or to use :Explore, the problem being the same).

  • What if you leave off the trailing slash? Interesting q
    – D. Ben Knoble
    Commented Oct 8, 2020 at 13:08
  • Unfortunately that doesn't work. If I remove the trailing slash: vim scp://userid@hostname//path/to/directory vim just create a new file.
    – Iel
    Commented Oct 9, 2020 at 7:21
  • Relevant thread: How to troubleshoot SSH-related issues in Vim?
    – toraritte
    Commented Oct 12, 2022 at 9:12


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.