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'm having trouble with read/write permissions on my Samba server, how do I fix my smb.conf and file permissions to have a more unified access?

smb.conf

[global]
workgroup = workgroup
netbios name = LnxNAS
server string = %h
wins support = no
dns proxy = no
security = user
encrypt passwords = yes
panic action = /usr/share/samba/panic-action %d

[homes]
comment = Home Directories

[Video]
path = /data/eric/Videos

[Music]
path = /data/eric/Music

[Pictures]
path = /data/eric/Pictures

[data]
path = /data
writeable = Yes

my ls -l of /data/eric/Pictures

drwxrwxrwx 2 ericfoss root     4096 2011-03-13 22:09 Android Projs
drwxrwxrwx 3 ericfoss root     4096 2011-03-13 22:09 Automotive
-rwxrwxrwx 1 ericfoss root     2439 2010-12-17 17:03 BDD reduction.png
-rwxrwxrwx 1 ericfoss root     2722 2010-12-17 16:55 BDD Tree.png
-rwxrwxrwx 1 ericfoss root     7341 2010-12-17 16:46 BDD Tree.xcf
-rwxrwxrwx 1 ericfoss root    72421 2007-11-22 22:59 Bum Ninja.jpg
-rwxrwxrwx 1 ericfoss root    32152 2010-12-17 21:25 cell transition.png
-rwxrwxrwx 1 ericfoss root    40212 2010-12-17 17:55 control graph.png
drwxrwxrwx 2 ericfoss root     4096 2011-03-13 22:09 Crap
-rwxrwxrwx 1 ericfoss root       82 2010-09-20 17:18 desktop.ini
ericfoss@SERVER:~$

Output from samba4 restart

sudo /etc/init.d/samba4 restart
 * Stopping Samba 4 daemon samba              [ OK ]
 * Starting Samba 4 daemon samba
Unknown parameter encountered: "guest ok"
Ignoring unknown parameter "guest ok"
Unknown parameter encountered: "guest ok"
Ignoring unknown parameter "guest ok"
Unknown parameter encountered: "writeable"
Ignoring unknown parameter "writeable"
Unknown parameter encountered: "valid users"
Ignoring unknown parameter "valid users"
                                              [ OK ]

I can't delete, rename or create files...

share|improve this question

3 Answers 3

up vote 6 down vote accepted

Samba has its own layer of access control for each share. There are two basic options

  • read only: by default every share is read-only, regardless of filesystem permissions,
  • writeable: in order to allow write access you should set writeable = Yes.

This should be enough to solve the problem. But if you'd like to learn more about Samba permissions, like how to set umask, enable guest account or control access for individual users/groups, then read the short tutorial on Samba permissions.

share|improve this answer
    
Problem is that my smb.conf isn't responding the same as the expected output... see my question update –  Eric Fossum Mar 20 '11 at 22:49
    
Could you explain to me why my settings don't take affect till I restart? (Yes, I know about sudo /etc/init.d/samba4 restart) –  Eric Fossum Mar 22 '11 at 5:17

Since you don't seem to need Active Directory integration, you're probably better off installing Samba 3 (in the "samba" package) rather than Samba 4, which has not been released yet.

"writeable = yes" is an alias for "read only = no" in Samba 3. The alias has been removed in Samba 4.

share|improve this answer

I just had same problem as OP. Samba config was set up correctly but still I could not write files.

My problem was that directory i wanted to share was created by root user so i had to chown that directory to my normal user and everything is working fine. I can create /delete and /modify files and folders now.

share|improve this answer

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.