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.

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 stackoverflow.com Jul 22 '12 at 2:46

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

add comment

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@192.168.1.1:/tmp/
share|improve this answer
    
if i want to use ssh please let me know the command –  Lakshmi Hayagreevan Jul 20 '12 at 9:05
add comment

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:

http://ultra.ap.krakow.pl/~bar/DOC/ssh_backup.html

share|improve this answer
add comment

Your Answer

 
discard

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