0

Is is possible to transfer files from local machine to server using FTP and terminal. For instance, can I create a file locally with vim, write my code, save it, then transfer that to a server without using something like Transmit, Filezilla, or Forklift?

1

2 Answers 2

1

You can even do that from within Vim! The netrw plugin ships with it and is enabled by default. One way to access remote files is by prefixing the filespec with the protocol, like this:

:w ftp://hostname/path/to/file

You can find out more about this via :help pi_netrw. Of course, you still need to have an FTP (SSH, ...) client on your system, and need to provide the credentials as well, so everything in @Gytis's answer still applies.

0

Assuming that FTP is enabled on your server you can use plain TCP/IP FTP connection. Interactively something like ftp username@server should work. user username once connected will let you login with a specific user if anonymous connections are disallowed or lack privileges. cd,ls and put would be your basic commands once logged in to upload files. The man pages will give you a lot more information on the more advanced commands and settings.If you have ssh working on your local machine and server then you can use SFTP. Commands are largely the same and would be something along the lines of sftp user@server and put filename. May want to cd to correct directory before putting the file. Secure copy would also work if your target server is *nix based. i.e. scp /file/to/move/file.txt username@server:/path/to/destination. Scp has -i option to specify your ssh key if that's how you connect to the server

2
  • 3
    SFTP != FTP
    – Attie
    Aug 20, 2018 at 16:57
  • You're right, should've read through the question more thoroughly. Updated the answer to better reflect the question
    – Gytis
    Aug 21, 2018 at 11:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .