dev-resources.site
for different kinds of informations.
Remotely Edit Files on Vagrant
Published at
2/15/2021
Categories
vim
ssh
scp
unix
Author
serhatteker
Author
11 person written this
serhatteker
open
We know we can edit files via scp
in Vim as we've seen in: Vim SSH.
$ vim scp://user@host//path/to/file/file.extension
Editing files on vagrant virtual machine is a little bit harder to achieve.
We can ssh
into vagrant (along with option vagrant ssh
) after adding our ssh public key:
$ ssh -i ~/.ssh/id_rsa.pub -p 2222 vagrant@localhost
More info about this: Add SSH Public Key to Vagrant
However we can't add these flags to scp
. So what is the solution then?
The solution is adding ssh config file as we've seen in SSH Config:
Host vagrantlocal
HostName localhost
Port 2222
User vagrant
IdentityFile ~/.ssh/id_rsa.pub
PasswordAuthentication no
After that we can remotely edit files:
$ vim scp://vagrantlocal//path/to/file/file.extension
All done!
scp Article's
18 articles in total
SCP Automation for AWS Organization
read article
Using SCP with ssh2 in Node.js Applications without SFTP
read article
Copy file between server and local machine ( from windows to linux server )
read article
How to Speed Up Large File Transfers: Tips and Tools for Faster Transfers
read article
Azure Service Principal creation step by step approach
read article
Ports for ssh, scp, rsync
read article
Transfer files to Ubuntu Linux EC2 instances using an SCP client from your computer
read article
Copy Files Compressed with Tar via ssh from and to a Linux Server
read article
Working with AWS Permission Policies
read article
ARCHIVING AND TRANSFERRING FILES
read article
Using SSH & SCP to Add Custom Remarkable Templates
read article
Scp Cheat Sheet
read article
Linux SCP for file transfer
read article
Remotely Edit Files on Vagrant
currently reading
Remotely Edit Files in Vim
read article
SCP: Sending files between servers using SSH
read article
Debugging issues with libcurl and publickey authentication
read article
SCP between two hosts with non-standard ports
read article
Featured ones: