Recently I found out that you can edit files that are hosted on a server with vim using the scp protocol, and keep your local
On this tutorial I'll be editing files that are hosted on an EC2 instance, to do this you'll need:
.cerfile for authorization
- The ip address that you'd normally use to connect to your server through ssh
And that's it! Let's first setup the permissions.
- On your terminal, run
vim ~/.ssh/configto either create or modify an existing config file
- Copy and paste the following, replacing it with your own server values
Host your-ec2-instance-name Hostname 220.127.116.112 User ubuntu IdentityFile /Users/myname/path/to/your-ec2-instance-name.cer PasswordAuthentication no
And that's it! You might be prompted with a message to authorize the host in which case you'll need to type yes.
Top comments (0)