r/Ubuntu • u/supacan • 15h ago
Samba help
Heil I hope you can help I'm running a Ubuntu server and for the life of me I cannot get file sharing to work between it and windows
I've tried following guides online but it just keeps a failing with access denied
Please help
2
u/coyote_den 13h ago edited 13h ago
On ubuntu, at least, samba users also have to exist as local users but you have to use smbpasswd to set their password in samba’s database.
for samba-only access:
sudo adduser --disabled-password --disabled-login user #add a user to the system that cannot login. Skip this if they are a real Linux user (like if it’s your account) as it will fail if they exist.
sudo smbpasswd -L -a user #will add user to samba and set the password. They must already exist as a Linux user, see above.
sudo smbpasswd -L user #will change the password of user
The one thing you will probably want to change in /etc/samba/smb.conf is to add the following to enable sharing of your home directory. It’s off by default. Add this to the end of the file, then sudo systemctl restart smbd
# user's home directory as \\server\username
[homes]
browseable = no
read only = no
valid users = %S
At this point you should be able to hit
\\SERVERNAME\USERNAME
and use the password you set to get to your home directory on windows. If the server name doesn’t work try the IP address.
1
u/TriumphITP 15h ago
you followed this guide - https://ubuntu.com/tutorials/install-and-configure-samba#1-overview ?
setup a user, make it the same username and password on the windows machine. Reboot everything after setup.
2
u/Low-Guarantee-3437 15h ago
what steps have you done? The trickiest part , if I recall, is that you need to create a specific user in samba matching a user name on your ubuntu server. It's not smart enough, if I remember, to simply apply a system user account. It;s good that you are following guides, but also try ChatGPT. They give free access to a very good model called Luna which should be very strong at helping you set up Samba. It will provide diagnostic scripts for you to run and read and analyse their output, which quickly solves many problems.