Solved

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

Posted on 2010-11-09
6
475 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 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:pisceswzh2010
Comment Utility
To torimar:

I will try your method and see.  Thanks.
0
 

Author Comment

by:pisceswzh2010
Comment Utility
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
Comment Utility
This is convenient!  Thanks!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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 how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now