That is my understanding, yes. Regardless of the flavor of public-key cryptography being used, one side of the communication needs a private key and the other side needs a public key. So, for any peer you want to send a message to, you need possession of their public key in advance. (Keep in mind that the VPN "server" is really just another peer and it can initiate connections to its peers.)
Hard to say without more info! A few ideas and things to check:
You might try SSHing with extra verbosity (e.g. ssh -vvv me@10.0.0.1) to see what SSH keys your computer is offering.
Make sure the corresponding public key exists in ~/.ssh/authorized_keys on the server, for the user account you're SSHing into.
Look in /var/log/auth.log on the server and see what messages sshd is emitting when you try to log in.
Make sure permissions on that ~/.ssh folder on the server are correct (sudo chmod 0700 ~/.ssh && sudo chmod 0600 ~/.ssh/*). Same for the ~/.ssh folder on your local machine.
You are the absolute best. Thank you so much for this tutorial and writeup. I've been working off and on for like a week to get the VPC thing working and, more importantly, understand what all the wierd arcane iptables magic was doing. Thanks again <3
He/Him/His. Engineering manager by day, home sysadmin by night. Thoughts here are mine only & do not represent those of my employer or any group of which I am a member.
Location
Quad Cities
Education
ABET-accredited Bachelor & Master of Science degrees in Mechanical Engineering
What they don't tell you about WireGuard you can't resolve private hostnames over it. So, for example, if your workflow relies on a remote client having access to local hostnameA, you're SOL. OpenVPN supports that right out of the box, and that's why I've stuck with it instead.
Ease of mixing technologies taking best advantage,
Good programming logic no matter the language;
International experience implementing solutions;
Self taught;
thanks for the tutorial, I'm around into the blogs and web site to try to get help. I have a Wireguard VPN on my VPS, using a generic tutorial config, i added some peers like my phone, and laptop and working good. When I enable the vpn on cellphone its show that my IP is same of my VPS server.
But I have raspberry pi that use pi hole, and when I enable the vpn on this device my DNS queries goes trough the VPS
and really I would like to access my raspberry but this device dont need to access the internet of wg0 only visible to another devices
I dont know how to configure my raspberry pi peers to connect on VPN but do not outgoing to internet
In other words I would like to access my raspberry but do not allow this peer to navigate to internet trough VPN.
They tell you all of this. Everyone tells you the same thing.
What they actually don't tell you is how to transfer keys securely between different devices.
Every tutorial on the internet either avoids this entirely or says just copy and paste which sure, does work for two VMs on the same device, but is not practical.
So outside of manually typing out a public key from my server into my client config file, how do I get it there? I don't understand why no one addresses this and most guides say "just copy and paste"
Super weird. If I'm on the same device and just copying and pasting why tf do I need wireguard?
If I have a secure channel for this, why do I need wireguard at all?
If I don't have a secure channel for this, how is my wireguard secure?
You have mentioned "UDP load balancer in front of multiple VPN servers, but... you might need some network trickery to allow multiple active VPN servers with the same IP address and you might also need sticky sessions"
Please help me out as, how to configure multiple wireguard vpn servers in active-active mode with the same configuration. I tried to establish the vpn connection between peers through multiple wireguard vpn servers in acitve-acitve mode by using UDP load balancer like keepalived.
Kindly let me know the network trickery to allow multiple active VPN servers with the same IP address
Something that is worth setting up is running wireguard in a container. Then write a cloud-init script that installs docker and in my case it builds the containers from a docker file, copies over a script to a container than configures wireguard. I then log into the the DO machine and just look at that logs to get the generated configs to paste into my local wireguard configuration. There's probably better ways of doing it as I was mostly just experimenting, but got bored once I got the bare minimum going. I use it all the time, though.
Thanks! Clearly written, I just gave it a go and it works!
Question:
[Peer]entry in the server's/etc/wireguard/wg0.conffile?me@10.0.0.1: Permission denied (publickey)., what's the problem here?I mostly want the VPN to allow me to access devices with ssh.
ssh -vvv me@10.0.0.1) to see what SSH keys your computer is offering.~/.ssh/authorized_keyson the server, for the user account you're SSHing into./var/log/auth.logon the server and see what messagessshdis emitting when you try to log in.~/.sshfolder on the server are correct (sudo chmod 0700 ~/.ssh && sudo chmod 0600 ~/.ssh/*). Same for the~/.sshfolder on your local machine.You are the absolute best. Thank you so much for this tutorial and writeup. I've been working off and on for like a week to get the VPC thing working and, more importantly, understand what all the wierd arcane iptables magic was doing. Thanks again <3
What they don't tell you about WireGuard you can't resolve private hostnames over it. So, for example, if your workflow relies on a remote client having access to local
hostnameA, you're SOL. OpenVPN supports that right out of the box, and that's why I've stuck with it instead.Would it be possible to work around that by creating an entry in /etc/hosts?
thanks for the tutorial, I'm around into the blogs and web site to try to get help.
I have a Wireguard VPN on my VPS, using a generic tutorial config, i added some peers like my phone, and laptop and working good. When I enable the vpn on cellphone its show that my IP is same of my VPS server.But I have raspberry pi that use pi hole, and when I enable the vpn on this device my DNS queries goes trough the VPS
and really I would like to access my raspberry but this device dont need to access the internet of wg0 only visible to another devices
I dont know how to configure my raspberry pi peers to connect on VPN but do not outgoing to internet
In other words I would like to access my raspberry but do not allow this peer to navigate to internet trough VPN.
This is the best guide on Wireguard.
They tell you all of this. Everyone tells you the same thing.
What they actually don't tell you is how to transfer keys securely between different devices.
Every tutorial on the internet either avoids this entirely or says just copy and paste which sure, does work for two VMs on the same device, but is not practical.
So outside of manually typing out a public key from my server into my client config file, how do I get it there? I don't understand why no one addresses this and most guides say "just copy and paste"
Super weird. If I'm on the same device and just copying and pasting why tf do I need wireguard?
If I have a secure channel for this, why do I need wireguard at all?
If I don't have a secure channel for this, how is my wireguard secure?
Thanks
@greg
You have mentioned "UDP load balancer in front of multiple VPN servers, but... you might need some network trickery to allow multiple active VPN servers with the same IP address and you might also need sticky sessions"
Please help me out as, how to configure multiple wireguard vpn servers in active-active mode with the same configuration. I tried to establish the vpn connection between peers through multiple wireguard vpn servers in acitve-acitve mode by using UDP load balancer like keepalived.
Kindly let me know the network trickery to allow multiple active VPN servers with the same IP address
Something that is worth setting up is running wireguard in a container. Then write a cloud-init script that installs docker and in my case it builds the containers from a docker file, copies over a script to a container than configures wireguard. I then log into the the DO machine and just look at that logs to get the generated configs to paste into my local wireguard configuration. There's probably better ways of doing it as I was mostly just experimenting, but got bored once I got the bare minimum going. I use it all the time, though.
we got such way. Thanks a lot thedigitalbin.com