Solved

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

Posted on 2010-11-09
6
479 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 35

Accepted Solution

by:
torimar earned 500 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Rate limit for DNS queries 7 93
How to enable sync between two yum repo? 1 54
maybe no no httpd.conf 6 77
simple bash script needed to unpack tar.gz 4 27
I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

756 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