2 nodes:
- node1
- node2
Node1
$ openvpn --genkey --secret /etc/openvpn/server.key
$ ssh-copy-id user@node2:/etc/openvpn/client.key
$ chmod 644 /etc/openvpn/server.key
$ scp -i ~/.ssh/id_rsa /etc/openvpn/server.key user@node2:/etc/openvpn/client.key
scp: /etc/openvpn/client.key: Permission denied
Node2
$ openvpn --genkey --secret /etc/openvpn/server.key
$ ls /etc/openvpn/
client server server.key
Can't copy server.key from node1 to node2.
/etc/openvpn
on node2 should be owned by root.You are trying to copy a file with
user@node2
, which is not allowed to write in/etc/openvpn