Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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
?
495 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 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

721 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