Page 1 of 1

[Resolved] Trouble SCP'ing static key off remote server

Posted: Mon Feb 17, 2014 8:29 pm
by foundrman
Hello All,

I am in the process of reconfiguring a remote OpenVPN server- I interact with it solely through SSH for now.

Getting away from certificates because of a particular users location we're setting up keys, and I generated a static key on the remote box

Code: Select all

sudo openvpn --genkey --secret /etc/openvpn/openvpn-key.txt
I'm now trying to SCP that file to my local machine. After hitting one brick wall after another, if I run the SCP command from my local machine I get the following:

Code: Select all

Warning: Identity file openvpn-key.txt not accessible: No such file or directory.
ssh: connect to host XX.XXX.XXX.XXX port 22: Network is unreachable
If I run the SCP command on the remote machine, it asks for a passphrase that I don't have nor ever created.

I've modified permissions on the remote file (though maybe not correctly?). I recognize that this may very well not be an OpenVPN issue, and as such I will certainly go elsewhere...but I thought I'd start here.

Thanks so much!

Re: Trouble SCP'ing static key off remote server

Posted: Tue Feb 18, 2014 7:38 am
by maikcat
I recognize that this may very well not be an OpenVPN issue
scp command requires ssh service to be working...
so yes its not an openvpn issue

but to help you out you can scp FROM a server to a client (your pc),
what OS your client (your pc) is using?
can you write down the exact command given?

Michael.

Re: Trouble SCP'ing static key off remote server

Posted: Tue Feb 18, 2014 11:53 pm
by foundrman
Thanks Michael, yes, this is not an OpenVPN issue.

I assumed ssh service was running since I can SSH to the remote machine without an issue. I would assume that if I can SSH successfully than the SSH service is running and thus SCP should work (all else being equal)

my client (local) is OS X
the command is, run from the local machine:

Code: Select all

scp ubuntu@XX.XX.XX.X:/etc/openvpn/openvpn-key.txt /Users/XXXXX/Desktop

SOLVED: Re: Trouble SCP'ing static key off remote server

Posted: Wed Feb 19, 2014 1:07 am
by foundrman
As expected it was a (lame) syntax error. Adding the -i flag and the .pem file in the SCP command fixed the problem.

Thanks all!