LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-20-2012, 08:41 AM   #1
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
Can't change permissions on file copy (samba).


Hello!
I've recently installed samba at debian host. And configured samba with full access for anybody without login/password.

At the server side shared partition type is ntfs, fstab options for share:
Code:
/dev/sda2	/media/servstor	ntfs-3g	umask=0		0	0
and here smb.conf:
Code:
[global]
       workgroup = WORKGROUP
       hosts allow = 192.168.
       interfaces = all
       log file = /var/log/samba/log.%m
       max log size = 1000
       syslog = 0
       guest account = nobody
       security = share
       unix charset = UTF-8

[share]
       path = /media/servstor
       comment = share
       printable = no
       writable = yes
       guest ok = yes
       create mask = 0777
       directory mask = 0777
At the linux client side (gentoo):
Code:
echo <pass> | sudo -S mount -t cifs //192.168.1.5/share /media/share -o workgroup=WORKGROUP,ip=192.168.1.5
I can mount share and can create, delete and copy files and folders. All fine except one thing: when I copy files to share, I get a message 'Can't change permissions for file <filename>' for each file that was copied. And I have to click 'OK' for each message. No problem on copying one or two files. But copy a folder with a hundreds of files - it is a really asspain
I read a tons of manuals and tried billions mounting options, rebuilt kernel with CIFS options, played with polkit settings, but nothing helps.
Can anyone help me?
Thanks in advance.

P.S.
I think server's configuration is OK because I have no these messages when I copying files to server from other desktop (with Arch installed).

Last edited by Teufel; 11-20-2012 at 01:55 PM.
 
Old 11-20-2012, 09:04 AM   #2
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 924

Rep: Reputation: 43
If the file system is NTFS then try to remove these entries from config
Code:
create mask = 0777
directory mask = 0777
and dont forget to restart samba after changes.
 
Old 11-20-2012, 09:15 AM   #3
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Original Poster
Rep: Reputation: 142Reputation: 142
Removed and restarted, doesn't helps.
I am sure that server's config is OK, because Arch works with this share fine.
 
Old 11-20-2012, 10:10 AM   #4
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 924

Rep: Reputation: 43
Post ls -al of samba shared dir with:
- file created locally on server
- file copied from remote machine

Send also ls -al of shared dir (itself).
 
Old 11-20-2012, 11:19 AM   #5
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Original Poster
Rep: Reputation: 142Reputation: 142
Files that was created at server has this attributes:
Code:
echo "aaa" > /media/servstor/server-test-file
ls -al /media/servstor/server-test-file
-rwxrwxrwx 1 root root 4 Nov 20 16:54 /media/servstor/server-test-file
File created at client:
Code:
echo "aaa" > client-test-file
ls -al client-test-file 
-rw-r--r-- 1 user user 4 Nov 20 16:55 client-test-file
After copy to share file's attributes changed:
Code:
ls -al /media/servstor/client-test-file
-rwxrwxrwx 1 root root 4 Nov 20 16:55 /media/servstor/client-test-file
attributes and owner was changed from 'rw-r--r-- 1 user user' to 'rwxrwxrwx 1 root root'

server-side mount directory has 'drwxrwxrwx 1 root root' attributes.

Last edited by Teufel; 11-20-2012 at 11:21 AM.
 
Old 11-20-2012, 12:09 PM   #6
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 924

Rep: Reputation: 43
In your global config there is set option:
Code:
guest account = nobody
change it to "root" (its possibly unsafe)

The right solution would be to set up this as following but since you are running it on NTFS it may not work (I dont have a place now to check it)
Code:
chown -R nobody:nbody /media/servstor
 
Old 11-20-2012, 01:02 PM   #7
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Original Poster
Rep: Reputation: 142Reputation: 142
chown does nothing.
'guest account = root' works only for root. Regular user still gets messages on file copy.
Also I tried 'guest account = <username>' - this also does nothing.
 
  


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
copy file and change permission ust Linux - Newbie 5 06-18-2012 09:01 AM
Samba file copy maximum of 2 GB? dcroxton Linux - Networking 6 02-13-2007 02:52 PM
can't copy file to debian using samba walterbyrd Linux - Networking 3 02-25-2005 07:52 AM
cant copy file from samba's share apeacez Linux - General 1 10-11-2004 10:06 AM
Samba file copy strangeness sts_cat Linux - Software 1 11-15-2002 09:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:32 AM.

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