Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I copy a file from my local machine to a remote server using ssh, I have tried the following code:

scp -o StrictHostKeyChecking=no -r $tarpath/$user@$server:$perfresdir/temp/ACK/
share|improve this question

migrated from Jul 22 '12 at 2:46

This question came from our site for professional and enthusiast programmers.

SSH? You are using scp.

It goes something like this :

scp local_location user@target_ip:target_location.

Example :

scp /tmp/myFile.tar root@
share|improve this answer
if i want to use ssh please let me know the command – Lakshmi Hayagreevan Jul 20 '12 at 9:05

You can try the following command:

cat localfile | ssh target_address cat ">" remotefile

For example:

cat local.txt |ssh $user@target_ip cat ">" remote.txt

For more details:

share|improve this answer

You must log in to answer this question.