[Samba] Re: can samba keep uid/gid/permission on a per-file-base?

charles charlesaburrell at gmail.com
Tue Jun 9 14:53:42 GMT 2009

> ---------- Forwarded message ----------
> From: peter pilsl <pilsl at goldfisch.at>
> To: samba at lists.samba.org
> Date: Tue, 9 Jun 2009 09:06:18 +0100 (GMT+01:00)
> Subject: [Samba] can samba keep uid/gid/permission on a per-file-base?
> Is there a trick to copy files via smbfs and keep uid/gid/permissions?
> Usually uid/gid/permission of a transfered file depends on the uid used
> when mounting the remote share.  But maybe there is a trick/patch whatever
> ...
> background:
> I'd like to use a linux-based NAS to backup loads of files *including their
> permissions and uid/gid*.  The NAS supports NFS (which can do what I want)
> but the NFS-connections breaks all the time.
> So smbfs/cifs is my available option.
> * I need to backup the files on a per-file-base (and not in a
> tar-container) to make the backup-files easily and fast accessible from any
> thinkable client.
> * rsync via ssh would be my last option, but ssh has lot of overhead and
> invokes a key-managment-strategy for automatic backup
> thnx,
> peter
> Hi,

I've recently gave a similar setup a shot. The group and user id's will
remain. You can test the gid/uid they'll be the same on both boxes.
However the permissions weren't quite what I needed them to be; it seems to
use the umask of the "samba authenticated user" and ignore smb.conf create

For you're purposes, I'd suggest rsync+sshfs OR "cp -p --parents -u -f
/source /dest" + sshfs. It is up to you but rsync is made to do what it
seems like you require.

Although you'll need to worry about keys for ssh you'd also have to worry
about passwords for samba.

good luck.


Belmopan, Belize

"... we just love cars and we love driving them!"

More information about the samba mailing list