Samba over Wireguard guide needed
Ima repost the entire content here from the other green forum, I'm in need this quick, hope I could find help from here:
I'm looking for a way to setup Samba shares over Wireguard correctly, but it seems I couldn't get it to work, literally spent an entire day messin the server and my PC getting the shares working but failed miserably, server is running Debian Bullseye, client is running Windows 10
Thanks in advance!
Comments
I assume the client and server can ping each other over the VPN. Firewall on the server?
smb.conf
/[global]
/interfaces
? How are clients to login to the samba server?I could ping, firewall disabled, client using explorer to log in, smb.conf is configured fitting with Wireguard, probably configuring Samba, making it works is a lot of headache
@Daniel is your guy
Do you get any error messages? It's hard to tell what's wrong when you just say it 'failed miserably' with no other info (error messages, what failed, etc)
I recently wrote a guide for NFS over WireGuard (https://d.sb/2020/12/nfs-howto). Not sure about Samba though, it's been a very long time since I last used it. The last time I used it was to share files between a Linux server (2.4.x kernel) and a Windows 98 PC back in the early 2000s ?
Some versions of Windows (I think just Windows Server and Windows 10 Enterprise) include an NFS client, but unfortunately it's only NFSv3.
Daniel15 | https://d.sb/. List of all my VPSes: https://d.sb/servers
dnstools.ws - DNS lookups, pings, and traceroutes from 30 locations worldwide.
NFS is easier in my experience.
I'd suggest something like this:
1) First check if serving anything works. i.e. all your VPN and portforwarding works. I usually do this via python 3's http.server
sudo apt install python3 python3-pip -y
mkdir test
cd test
touch testing
python3 -m http.server
...that'll start a server on port 8000 sharing the empty test file you created via a http server. If you can access that remotely then vpn is fine
2) Samba - easiest is anonymous share in my experience - but obviously reliant on the VPN for security then cause no password.
In the samba config it's this
3) Kinda hacky but easiest way around getting user rights to folder to work is via group permissions. i.e. add the incoming samba user to whatever group is set on the folder in question. Remember to apply group recursively and if applicable change it to 774 access. Reasonably sure this is the wrong/dangerous way but that's what I settled on after also spending a day on this kak. (I'm all ears if someone knows the correct way).
Win10Pro has it too
I have SAMBA 3.6 on my home router. The config smb.conf is as follows and it is compatible with Windows 10.
Probably NFS could save me a few hours I guess, I'll try to get it setup today
I actually followed your guide, switching around with the configuration, and when doing mounting (mount //10.1.2.3/data Z:, mount 10.1.2.3:/data Z:, net use Z: //10.1.2.3/data as a regular user) it just refused to mount (Network error 53 -- The network path was not found), I tried changing the provider order, firewall is disabled b4 I did this thread, pinging the server is fine, showmount does show something (ERROR - Unsupported Windows version), checking netstat shows the port 111 and 2049 are listening, I also spun up a vps and set up nfs-client and wireguard on it and probably my bad when it returns access denied by server, I can't really find more stuff atm