-4

Password-free ssh authentication had been set.
There is a file /home/test.txt in my remote_ip.

vim scp://root@remote_ip//home/test.txt

Why vim scp can't read file on my remote vps?

vim  --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38)
ls -al   /home/test.txt
-rw-r--r-- 1 root root 100 Apr 23 12:40 /home/test.txt
enough space left on both local and remote device.
ssh credential established between my vps and local pc.

To connect with my vps.

ssh  -i .ssh/id_rsa  -p 1000  root@remote_ip

The port number is 1000 not standard 22.

closed as off-topic by Martin Tournoij Apr 24 '18 at 13:31

  • This question does not appear to be about Vi and Vim family of editors, within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 5
    Without any information at all it will be extremely hard to give any meaningful answer to this. Basically your question is just "it doesn't work". Okay ... but what are the results? What are your settings? etc Even with all information, this is a very difficult problem to solve over the internet, as there are just so many variables involved. your best bet is really to look at the ssh logs etc. yourself and debug from there. – Martin Tournoij Apr 20 '18 at 3:04
  • I'm voting to close this question as off-topic because it does not contain nearly enough information to give a meaningful answer. Please see e.g. How to create a Minimal, Complete, and Verifiable example? – Martin Tournoij Apr 24 '18 at 13:31
3

Okay, I'm blind shooting here, but here are some ideas

  • You have older vim version than 6.
  • The remote file is not readable
  • No space left on the local device.
  • Local firewall blocks the outgoing connection
  • Remote firewall blocks the connection
  • Your ssh public key is not in the authorized_keys file on remote
  • Your local ssh keys are not in the default folder .ssh

You may want to debug your ssh connection first with ssh xy@remote -vvv to find out if the connection can be established.

  • Connection can be established with ssh -i .ssh/id_rsa -p 1000 root@remote_ip – it_is_a_literature Apr 25 '18 at 3:27
  • 1
    @it_is_a_literature do you specify the port? You can create an entry in ~/.ssh/config, use vim scp://root@remote_ip:1000//home/test.txt or let g:netrw_scp_cmd="scp -q -P 1000". – LEI Apr 27 '18 at 9:14

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