Você precisa da opção uid=
e talvez gid=
mount. Consulte man 8 mount.cifs
:
uid=arg
sets the uid that will own all files or directories on the mounted filesystem when the server does not provide ownership information. It may be specified as either a username or a numeric uid. When not specified, the default is uid0
. Themount.cifs
helper must be at version 1.10 or higher to support specifying the uid in non-numeric form. See the section on File And Directory Ownership And Permissions below for more information.
gid=arg
sets the gid that will own all files or directories on the mounted filesystem when the server does not provide ownership information. It may be specified as either a groupname or a numeric gid. When not specified, the default is gid0
. Themount.cifs
helper must be at version 1.10 or higher to support specifying the gid in non-numeric form. See the section on File And Directory Ownership And Permissions below for more information.[…]
File And Directory Ownership And Permissions
The core CIFS protocol does not provide unix ownership information or mode for files and directories. Because of this, files and directories will generally appear to be owned by whatever values theuid=
orgid=
options are set, and will have permissions set to the defaultfile_mode
anddir_mode
for the mount. Attempting to change these values viachmod
/chown
will return success but have no effect. […]
Esta seção também menciona um cenário em que "o cliente e o servidor negociam extensões unix" e um cenário em que "também é possível emulá-los localmente no servidor", etc.
No seu caso, uid=
e gid=
simples devem ser suficientes. Observe que eles especificam o usuário e o grupo Unix, uid=
e username=
são diferentes e, em geral, podem ter valores diferentes.
sudo mount -t cifs -o uid=millironx,gid=users,username=millironx,password=mypassword,domain=AD //files.example.com/shared /mnt
Você também pode encontrar esta pergunta útil.