[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!
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Trouble SCP'ing a file from remote server to local machine, running out of ideas!
Hello All!
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.
gives me the same error. I have no doubt I am missing something on the command syntax (or something equally minor)...any help would be greatly appreciated. Thanks!
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
Code:
user2@host2.net:/path/to/filename2
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 07:20 PM.
I haven't, their forum is probably next if this really is a Amazon EC2 thing vice just my Linux newb'ness.
They might be doing something with SSH, but I have SSH opened on server (via the Amazon config mechanism). I can also SSH to it without any issues using standard commands and the pen file.
I haven't, their forum is probably next if this really is a Amazon EC2 thing vice just my Linux newb'ness.
They might be doing something with SSH, but I have SSH opened on server (via the Amazon config mechanism). I can also SSH to it without any issues using standard commands and the pen file.
assuming contents of openvpn-key.txt.pub are in /home/ubuntu/.ssh/authorized_keys on the Amazon host and that authorized_keys file is 600 and owned by ubuntu:ubuntu
(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
Code:
-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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.