[SOLVED] Trouble SCP'ing a file from remote server to local machine, running out of ideas!
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Trouble SCP'ing a file from remote server to local machine, running out of ideas!
I have a server running on Amazon EC2, and I have generated a file on that remote server (via an SSH connection) that I'd like to move to my local machine (FWIW this file is a OpenVPN key file, i.e. 'openvpn-key.txt').
I'm been trying a number of different variations of the SCP command and none seem to work.
The -i option is to indicate the location/name for the ssh private key if different then the default. if you want to copy a file then the command is as stated above. If I understand what you are copying in your case /path/to/filename1 would be /etc/openvpn/openvpn-key.txt
the current directory on the local machine (i.e. where I am running the command from) is where the .pem file for the remote server sits...so my thought was that the -i would capture that as long as I was in the right directory.
I believe you're right, re: the path for filename 1.
This seems like (or is) a stupid question, but this
has me confused, as user2@host2 is me at my local machine, and the filename shouldn't change, hence copy. Right?
Stumped is an understatement! I added sudo back...sadly same error. Of course all sudo does is add those permissions to the local user on the local machine. This error is almost certainly based on something server side.
The link you sent is a good one, one I found as well. To address those points. I use the same .pem file to successfully SSH to the instance, so we're good on that one. And for the user, it's an Ubuntu instance, so I'm using that username as well.
FWIW I also tried Filezilla. I can connect and browse the remote server. When I try to download the same file though, it gives me an error
Error: local: unable to open /openvpn-key.txt
Error: File transfer failed
Last edited by bowserface; 02-17-2014 at 08:20 PM.
(1) I'm not sure what you mean by "openvpn-key.txt.pub", maybe you mean the specific key file I'm trying to move? The key file contents I am trying to SCP are not the same as the contents of Authorized Keys in the .ssh directory.
(2) Also, the contents of the .pem file I use to connect to the remote machine via SSH is not the same as authorized key file either. Perhaps this is the issue?
(3) chmod to 600 and confirmed ubuntu is the owner
-rw------- 1 ubuntu ubuntu 389 Feb 17 19:00 authorized_keys
(4) /etc/openvpn is the folder path, the file I am trying to move is within that folder.