Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to set up a Ubuntu server 12.04 nas using samba file sharing. I first tried to set it up with webmin and when that didn't work, I tried to set it up manually using the vi editor modifing the /etc/samba/smb.conf. Both times the results were the same.

Over the network all users can open the share (empty) but cannot write to the share (permission denied). This is the same for both Linux and windows machines.

My smb.conf in part looks like:

[John]
  writable = yes
  invalid users = kid1 kid2 kid3
  path = /SharedMedia/John
  comment = John
  valid users = john wife
  browsable = yes
  create mode = 777
  directory mode = 777

[Public]
  writable = yes
  path = /SharedMedia/Public
  comment = Public
  valid users = john wife kid1 kid2 kid3 virtualbox 
  browsable = yes
  create mode = 777
  directory mode = 777

(users on the system include: john, wife, kid1 kid2 kid3 and virtualbox for virtual machine - names hidden for privacy)

All users exist as linux users and samba users and have the same password for both.

note: I never did set up samba groups as it did not appear to apply to my use. For example: all users have have their own share on the server but other users should not be allowed to access it. Therefore I did not set up groups because there were few shares that all users access.

I honestly cannot figure out what is holding me back. Thanks for your help.

share|improve this question

1 Answer 1

This may be due to the permissions/owner on the shared folder(s) themselves.

Try to log into the server as one of the users and write to the same directory.

Are the client machines asking for a password when you connect? If not, this could indicate that you are being connected as 'guest'.

This guide might help

share|improve this answer
    
I tried to login just now with two different accounts on two different computers, and there is still no happiness here. The windows machine did ask for user name and password (tried two different accounts) while the linux machine did not. Both computers said that I didn’t have permission to write to the share. –  user255190 Mar 6 at 1:55
    
i meant use the server machine, either directly by using e.g.su john in a terminal (Ctrl+alt+t) on the server machine, or using ssh from one of the client machines. Then go to john's shared directory and do touch test, or check the owner/permissions on the directory. On a public folder, the permissions will need to be read write for everyone. –  Loopo Mar 6 at 7:33
    
Yep. You are on to something. "cannot touch 'file1': Permission Denied". I will look into changing permissions on the linux side and then see what happens. –  user255190 Mar 6 at 16:18
    
Thank you Loopo. That did the trick. I did "chown -R john /SharedMedia/John/" and now I can write to the folder over the network. I still have to figure out how to set ownership and permissions on other shared folders such as /SharedMedia/Photos/ where mom and dad can read and write but kids can only read. I guess samba can control that since everyone connects through the network. But would the linux machines follow samba permissions? –  user255190 Mar 6 at 18:54
    
That's where groups come in, you could have a group adults that would have read/write access, make those users members of the group, use chgrp on the directory to set the group, and chmod u+rw, g+rw, o-w to allow others only read access. You should probably sync your linux/samba users once you're done –  Loopo Mar 7 at 2:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.