networking - How to use Vim to edit files using SCP but across different Subnets? -


i'm learning networks , found out scp protocol used edit files on other computer. thing other computer should on same network. curious how edit files across different networks?

additional information: in college have computer labs. each lab has 1 switch. computers in particular lab connected switch. of labs have internet connection. if want edit file using vim on computer friend on over different lab, how can it?

application-level protocols ssh , http use underlying tcp/ip connection; work regardless of subnet (barring extended networking features firewalls, packet filters, network proxies, etc.)

so, if friend's computer reachable via internet, or local lab network, , have ip address / dns name of computer, , corresponding port (22 ssh / scp) not blocked, , have login on computer, can remotely edit files there.

if end goal remote editing, approach via these steps, each building on top of previous one:

  1. ping othercomputer
  2. ssh user@othercomputer
  3. in vim: :edit scp://user@othercomputer/path/to/file

Comments