[SOLVED] Why can't my Windows clients write to my Samba shares (Unbuntu 14.04)
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Why can't my Windows clients write to my Samba shares (Unbuntu 14.04)
I'm struggling with Samba with a new NAS/Media server I am trying to build. I have created some shares on my Unbuntu server with Samba that are visible and browseable from my home Windows 8.1 clients but when I try to write to any of them I receive a "try again" error.
I want to be able to copy files from my PC to my new Unbuntu server's shares. For now I have one user only on my Unbuntu server that's in the sudo group. From Windows I have tried to map network drive with "different credentials" but no matter what I try from Windows I still can't copy or move files from Windows to the shares.
What does your Samba configuration look like? It's probably a simple permissions issue. Either the users that are connecting via Samba don't have write permission to the shared directories, or they're connecting as a guest and the guest user doesn't have write permission to the shared directories.
Last edited by suicidaleggroll; 02-16-2015 at 01:34 PM.
#======================= Share Definitions =======================
;[homes]
; comment = Home Directories
; browseable = no
; read only = yes
; create mask = 0700
; directory mask = 0700
; valid users = %S
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
; write list = root, @lpadmin
Kiniku is the original account I created when the server started. I've been using it for "sudo" admin functions as well. So I assumed that account had admin/write access to everything created by default. It's probably the only account I'll ever use on the server as I only want the server for media serving/streaming and storage of personal documents/data in more a NAS function.
Do I need to specifically grant permissions to the media folder/shares?
Also if I may, I will be potentially storing sensitive personal data in one of the shares. So I would prefer not to make the server's shares and folders "wide open" just to gain simple full access. I am running this server for my home and I have one Windows 8.1 box I use for daily work. On that I am just in a default "workgroup" group. Is there a way that Samba can use my Windows 8.1 local accounts for authentication and access on the Unbuntu server side transparently so I could use my existing Windows account credentials on the Unbuntu server? I am not running a WINS server, DC or anything at home.
Kiniku is the original account I created when the server started. I've been using it for "sudo" admin functions as well. So I assumed that account had admin/write access to everything created by default. It's probably the only account I'll ever use on the server as I only want the server for media serving/streaming and storage of personal documents/data in more a NAS function.
Do I need to specifically grant permissions to the media folder/shares?
Thank you for your time.
Ignore sudo, Samba does not use it, neither does any other service. Linux is not like Windows where user accounts can be either "regular" or "admin". Ubuntu is trying they're damnedest to make it that way, but thankfully it's not catching on. User accounts are just user accounts, root is root. Your user account also happens to be in the sudoers file, which allows you to escalate yourself to root when you use the "sudo" command and type in your password, but that is a completely separate topic and should be ignored.
If you want to be able to write to a directory as your user, you need to make sure that your user has write access to that directory, without having to escalate to super-user (sudo) privileges.
---------- Post added 02-16-15 at 03:18 PM ----------
Quote:
Originally Posted by kiniku70
Is there a way that Samba can use my Windows 8.1 local accounts for authentication and access on the Unbuntu server side transparently so I could use my existing Windows account credentials on the Unbuntu server?
I don't know enough about Windows to answer that.
Last edited by suicidaleggroll; 02-16-2015 at 04:19 PM.
Ignore sudo, Samba does not use it, neither does any other service. Linux is not like Windows where user accounts can be either "regular" or "admin". Ubuntu is trying they're damnedest to make it that way, but thankfully it's not catching on. User accounts are just user accounts, root is root. Your user account also happens to be in the sudoers file, which allows you to escalate yourself to root when you use the "sudo" command and type in your password, but that is a completely separate topic and should be ignored.
If you want to be able to write to a directory as your user, you need to make sure that your user has write access to that directory, without having to escalate to super-user (sudo) privileges.
Suicidaleggroll that explanation helped me understand a great deal why this wasn't working. As it stands the kiniku account by default only has ownership of it's home folder and anything I put within it. What threw more confusion into it is I have been using webmin and I guess webmin does it's commands as root or at least elevated higher. But any changes I made such as folder creations or mountings under webmin did not guarantee my kiniku user could write or even see/access them because the kiniku user it seems can only see within it's home folder. Once I figured that out I was able to get things working properly now that I understand the limitations of this user. With Windows your first user that is created during install is God. So your explanation helped me understand that wasn't the case with unbuntu.
Also changing the folder attribute from 755 to 775 made them all visible, accessible, and writable to Windows. So now Windows can see and write to them. Finally! But I have one issue now:
I have unbuntu installed on a single 256GB drive. So of course my kiniku home folder resides there too. But I have a two 1TB drives that are unused. I would like to store my NAS and Media data on one of those empty drives AND allow the kiniku user to have full access to them. So I created a partition on one 1TB drive and mounted it in a new folder I had made in the home/kiniku folder named "data". But once made I can only see it. Its locked down because only "nobody" owns it. So my kiniku account cannot make changes to it in any way.
How can I add this entire drive so that my unbuntu kiniku account has read/write/exec administration permissions on it? It can be mounted anywhere as far as I am concerned.
I'm not sure how to do it with Webmin, but if you chown and chmod the mount point of the partition from the command line, your user account will be able to write to it. Since you have the partition mounted on /home/kiniku/data from what you've said, the following command should give all access to the kiniku user and no access to anyone else:
You might want to consider reading a short tutorial on *nix-style permissions, which will help you understand the chown and chmod commands a bit better.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.