samba/permissions

I have got a problem that drives me crazy.

My situation:

Fileserver called zefod running Debian Etch v 2.6


user bill, uid 1001, group users, gid 100

Homedir:

bill@Marvin:~> ssh bill@zefod
Password:
Linux zefod 2.6.26.5 #1 Tue Sep 16 18:11:30 CEST 2008 ppc

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Dec 28 16:20:58 2009 from 192.168.10.51
bill@zefod:~$

bill@zefod:~$ id
uid=1001(bill) gid=100(users) groups=100(users)
bill@zefod:~$

bill@zefod:~$ ls -n
total 16
drwxr-x— 2 1001 100 4096 2009-10-25 17:41 downloads
drwx------ 16 1001 100 4096 2009-12-29 10:24 Mail
drwx------ 47 1001 100 4096 2009-12-21 19:30 private
drwx------ 2 1001 100 4096 2009-01-14 17:59 torrents
bill@zefod:~$
bill@zefod:~$ cd private
bill@zefod:~/private$ ls -n
total 10992
drwxrwxr-x 40 1001 100 4096 2009-11-25 09:25 0ALTIJD BEWAREN
-rwxrw-r-- 1 1001 100 815710 2009-01-17 17:13 100_1365.JPG
-rwxrw-r-- 1 1001 100 864838 2009-01-17 17:13 10TUNING_Maxiscooter.pdf
-rwxrw-r-- 1 1001 100 39 2009-12-17 16:46 123.txt
-rwxrw-r-- 1 1001 100 39 2009-12-17 17:01 123.txt~
-rwxrw-r-- 1 1001 100 8878 2009-01-17 17:13 130-309511_IMG.JPG
-rwxrw-r-- 1 1001 100 82193 2009-01-17 17:13 130-30951_IMG.JPG
-rwxrw-r-- 1 1001 100 2 2009-12-17 17:48 345.txt
-rwxrw-r-- 1 1001 100 3640 2009-01-17 17:13 389601
-rwxrw-r-- 1 1001 100 56631 2009-02-01 11:56 3kk600.jpg
-rwxrw-r-- 1 1001 100 13 2009-12-17 19:47 456.txt
-rwxrw-r-- 1 1001 100 13 2009-12-17 19:48 456.txt~

Workstation called Marvin, running opensuse 11.1 kde 3.5


bill@Marvin:~> id
uid=1001(bill) gid=100(users) groups=6(disk),16(dialout),33(video),100(users),1000(MOGEN)
bill@Marvin:~>

The homedir on zefod is mounted on marvin at /zefod/bill via .kde/Autostart with the line:
sudo mount -t cifs //192.168.10.1/home/bill /zefod/bill -o username=bill,credentials=/home/bill/.creds,noperm

bill@Marvin:~> cd /zefod/bill
bill@Marvin:/zefod/bill> ls -n
total 0
drwxr-x— 2 1001 100 0 2009-10-25 17:41 downloads
drwx------ 16 1001 100 0 2009-12-29 10:24 Mail
drwx------ 47 1001 100 0 2009-12-21 19:30 private
drwx------ 2 1001 100 0 2009-01-14 17:59 torrents
bill@Marvin:/zefod/bill> cd private
bill@Marvin:/zefod/bill/private> ls -n
total 10812
drwxrwxr-x 40 1001 100 0 2009-11-25 09:25 0ALTIJD BEWAREN
-rwxrw-r-- 1 1001 100 815710 2009-01-17 17:13 100_1365.JPG
-rwxrw-r-- 1 1001 100 864838 2009-01-17 17:13 10TUNING_Maxiscooter.pdf
-rwxrw-r-- 1 1001 100 39 2009-12-17 16:46 123.txt
-rwxrw-r-- 1 1001 100 39 2009-12-17 17:01 123.txt~
-rwxrw-r-- 1 1001 100 8878 2009-01-17 17:13 130-309511_IMG.JPG
-rwxrw-r-- 1 1001 100 82193 2009-01-17 17:13 130-30951_IMG.JPG
-rwxrw-r-- 1 1001 100 2 2009-12-17 17:48 345.txt
-rwxrw-r-- 1 1001 100 3640 2009-01-17 17:13 389601
-rwxrw-r-- 1 1001 100 56631 2009-02-01 11:56 3kk600.jpg
-rwxrw-r-- 1 1001 100 13 2009-12-17 19:47 456.txt
-rwxrw-r-- 1 1001 100 13 2009-12-17 19:48 456.txt~
bill@Marvin:/zefod/bill/private>

Now the problem:

  • When i copy with konqueror a file to /zefod/boll/private i get

    Could not change permissions for
    /zefod/bill/private/file to copy

    The file is copied.

  • When I create a file with kwrite and try to save it as /zefod/bill/private/testbill.txt it is save without comment.
    But when I open this file with kwrite, edit it and then try to save it I get:

                        The document could not be saved, as it was not possible to write to file:///zefod/bill/private/testbill.txt.
                        Check that you have write access to this file or that enough disk space is available.
    

    I cannot save the file.

    bill@Marvin:~> cd /zefod/bill/private
    bill@Marvin:/zefod/bill/private> ls -n billtest.txt
    -rwxrw-r-- 1 1001 100 13 2009-11-17 22:47 billtest.txt
    bill@Marvin:/zefod/bill/private>

This looks normal to me, but when I look at the permissions of billtest.txt with konqueror
the permissions for Owner, Group and Others are greyed out and konqueror claims:
“This file uses advanced permissions”

When I click “Advanced Permissions” Set Uid, Set Gid and Sticky are not checked.

on directories in /zefod/bill/private the permissions are NOT greyed out, on all the files they are

I googled for weeks to no avail.

I cannot use my server
I am desperate by now

So your Debian computer is a Samba server, right?

How did you set up the shares in smb.conf on Debian? Did you remember to add read only = no to [homes] (or alternatively writable = yes)? That caught me a couple of times, as the default is read only = yes on shares unless overridden. You don’t see this reflected in the Unix permissions unfortunately. You could also have looked in the Samba log file on Debian, and it would have said something like read-only share on the failed access. (Linux tip #6: Log files are your friends.)

You don’t need to use konqueror or kwrite to test writability of the share, just do

cd /zefod/bill/private
touch foo

This is my smb.conf:

bill@zefod:~$ more /etc/samba/smb.conf
[global]

workgroup = Dbr
server string = %h Miniserver
dns proxy = no

log file = /var/log/samba/log.all
max log size = 1000
syslog = 0

security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
guest account = nobody
invalid users = root
map to guest = Bad User

socket options = TCP_NODELAY
preferred master = yes
load printers = yes
printcap name = cups
printing = cups
show add printer wizard = no
disable spoolss = Yes

interfaces = eth1
bind interfaces only = yes

#======================= Share Definitions =======================

[home]
comment = Home Directories
path = /home
browseable = yes
writable = yes
create mask = 0764
directory mask = 0775
public = no
guest ok = no
hide dotfiles = yes
user = @users

[storage]
comment = Common storage
writable = yes
guest ok = yes
public = yes
force group = users
force create mode= 0777
force directory mode = 0777
path = /home/storage

[printers]
comment = Attached printers
path = /var/spool/samba
browseable = no
guest ok = yes
printable = yes
use client driver = yes

bill@zefod:~$

touch foo gives me this:

bill@Marvin:/zefod/bill/private> touch foo
touch: setting times of `foo’: Invalid argument
bill@Marvin:/zefod/bill/private>

Ok, that is something much deeper. And that error message gives a better starting point. Searching on samba “setting times” “invalid argument” turned up this bug report. See if the remedies there will help you.

Bug 12246 – File permission problem only with linux client

BTW why CIFS from Linux to Linux? Why not NFS?

SOLVED!!

Thank you very much ken_yap

“host msdfs = no” in /etc/samba/smb.conf did the trick for mee.

BTW I use samba because I have also windows workstations in my network.

Thanks Leo

Excellent.

But running Samba doesn’t mean you can’t export those partitions with NFS as well.