Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How can I copy a file from a local machine to a remote ubuntu server using putty?

Posted on 2010-11-09
6
Medium Priority
?
509 Views
Last Modified: 2012-05-10
How can I copy a file from a local machine to a remote ubuntu server using putty?

I used the command "scp -r localfile.txt username@192.168.0.1:/home/username/", but it seems that localfile.txt must reside on a specific location, otherwise the file cannot be located.  Please help!  Thanks.
0
Comment
Question by:pisceswzh2010
  • 3
  • 2
6 Comments
 
LVL 35

Accepted Solution

by:
torimar earned 2000 total points
ID: 34098788
If you are using a Windows computer for copying to the remote server, the easiest way is to take WinSCP: http://winscp.net/eng/index.php
0
 
LVL 35

Expert Comment

by:torimar
ID: 34098801
WinSCP does make use of Putty and of the SCP client that comes with Putty. It's in essence just an interface for SCP.

If you insist on using the command line SCP though, make sure either your source file is in the current directory (the one you are in when issueing the copy command), or the exact path is given, i.e. c:\some_folder\localfile.txt
0
 
LVL 1

Expert Comment

by:mikepflu
ID: 34098803
First, make sure that you have the full path to localfile.txt.

"scp -r </full/path/to/localfile.txt> username@192.168.0.1:/home/username/",

Another alternative is to make sure that you are in the directory where "localfile.txt" exists first, by typing:  cd /path/to/localfile.txt, then issue the scp command.
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

Author Comment

by:pisceswzh2010
ID: 34098898
To torimar:

I will try your method and see.  Thanks.
0
 

Author Comment

by:pisceswzh2010
ID: 34098904
To mikepflu:

Actually I'm copying files from a Windows 7 machine to the Ubuntu and I'm using putty to ssh into the Ubuntu from the Windows 7 machine.  I'm not sure how should I construct the full path to localfile.txt.  Should I use a shared folder or what?  Thanks.
0
 

Author Closing Comment

by:pisceswzh2010
ID: 34098925
This is convenient!  Thanks!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month13 days, 3 hours left to enroll

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question