Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My professor wants us to email him source files, but he wants us to edit over ssh using vi. How do I transfer a file over ssh from one machine to another?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

To transfer a file over ssh you should use the scp command.

Basic usage is :

[you@localhost ~]$ scp examplefile yourusername@remoteserver:/home/yourusername/

It will copy over SSH the file examplefile to the remote server at the location /home/yourusername/examplefile

More concrete example :

[Moshe@localhost ~/mywork]$ scp thework.zip Moshe@192.168.1.21:/home/Moshe/

Where it is assumed your local file is /home/Moshe/mywork/thework.zip and you have permission to login to the server 192.168.1.21 and to write in the remote directory /home/Moshe

You will end with the file copied under /home/Moshe/thework.zip on the remote server.

If you are not working under Linux or any Unix-based system locally (ie. you're on Windows typically), a tool like WinSCP will enable you to transfer the file over SSH with help of a graphical interface.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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