LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-16-2015, 12:57 PM   #1
kiniku70
LQ Newbie
 
Registered: Feb 2015
Location: South Jordan Utah
Distribution: Unbuntu
Posts: 9

Rep: Reputation: Disabled
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.

Thank you
 
Old 02-16-2015, 01:32 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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.
 
Old 02-16-2015, 01:38 PM   #3
kiniku70
LQ Newbie
 
Registered: Feb 2015
Location: South Jordan Utah
Distribution: Unbuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
I appreciate the reply. I think everything is correct. But here in my Samba Conf file:

#======================= Global Settings =======================

[global]
panic action = /usr/share/samba/panic-action %d
security = user
usershare allow guests = yes
server string = %h server (Samba, Ubuntu)
wins support = true
os level = 20
workgroup = WORKGROUP
unix password sync = yes
syslog = 0
log file = /var/log/samba/log.%m
winbind use default domain = yes
encrypt passwords = yes
map to guest = bad user
server role = standalone server
pam password change = yes
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
winbind trusted domains only = yes
passdb backend = tdbsam
passwd program = /usr/bin/passwd %u
dns proxy = no
obey pam restrictions = yes
max log size = 1000

; wins server = w.x.y.z
; interfaces = 127.0.0.0/8 eth0
; bind interfaces only = yes

; logon path = \\%N\profiles\%U
; logon drive = H:
; logon script = logon.cmd
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
; add group script = /usr/sbin/addgroup --force-badname %g

############ Misc ############
; include = /home/samba/etc/smb.conf.%m
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

#======================= 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


[Media]
valid users = kiniku
writeable = yes
path = /media
public = yes
 
Old 02-16-2015, 01:57 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Are you connecting to the samba share as kiniku, and does kiniku have write access to /media?
 
Old 02-16-2015, 03:20 PM   #5
kiniku70
LQ Newbie
 
Registered: Feb 2015
Location: South Jordan Utah
Distribution: Unbuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
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.
 
Old 02-16-2015, 03:31 PM   #6
kiniku70
LQ Newbie
 
Registered: Feb 2015
Location: South Jordan Utah
Distribution: Unbuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
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.
 
Old 02-16-2015, 04:17 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by kiniku70 View Post
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 View Post
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.
 
1 members found this post helpful.
Old 02-16-2015, 07:22 PM   #8
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Also if you're using selinux you have to configure selinux to allow samba to use the /media directory.
 
1 members found this post helpful.
Old 02-17-2015, 12:58 AM   #9
kiniku70
LQ Newbie
 
Registered: Feb 2015
Location: South Jordan Utah
Distribution: Unbuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
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.

Last edited by kiniku70; 02-17-2015 at 01:01 AM.
 
Old 02-17-2015, 07:12 AM   #10
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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:

Code:
sudo chown kiniku:kiniku /home/kiniku/data
chmod 0700 /home/kiniku/data
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.
 
1 members found this post helpful.
Old 02-17-2015, 03:00 PM   #11
kiniku70
LQ Newbie
 
Registered: Feb 2015
Location: South Jordan Utah
Distribution: Unbuntu
Posts: 9

Original Poster
Rep: Reputation: Disabled
That did the trick. This project has really come along well. Thank you all for the replies.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu 8.04 in windows network cannot get write access for all samba shares cliffsur Linux - Newbie 6 09-18-2008 12:29 PM
Windows ME cannot write to SAMBA shares apostate Linux - Software 2 07-30-2005 10:56 PM
Samba shares crash Windows clients GT_Onizuka Linux - Software 5 07-01-2005 11:02 AM
Can not write to Samba Linux Shares from Windows boyd98 Linux - Software 2 05-12-2005 05:51 PM
Linux can mount samba shares but not windows shares bindsocket Linux - Software 1 12-01-2003 05:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration