Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

2 Answers 2

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

Your Answer


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