Solved

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

Posted on 2010-11-09
6
477 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
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

776 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