como posso permitir que meu usuário copie arquivos para o compartilhamento de samba sem raiz (sudo)?

2

Montei um compartilhamento de samba no meu sistema em um ponto de montagem que tornei acessível ao mundo com chmod 777 e chown -edi-lo para meu usuário, mas assim que montei o compartilhamento, as permissões mudaram para 755 e o usuário muda para root . Então, como posso tornar o compartilhamento gravável para meu usuário?

    
por cerr 01.08.2016 / 04:55

1 resposta

3

O protocolo lida com essas permissões

Você precisa configurar essas permissões quando montar o compartilhamento. Veja a man page de mount.cifs ou o link abaixo.

link

Tome nota especificamente das seguintes

file_mode=arg If the server does not support the CIFS Unix extensions this overrides the default file mode.

dir_mode=arg If the server does not support the CIFS Unix extensions this overrides the default mode for directories.

Há também

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 uid 0. The mount.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.

forceuid instructs the client to ignore any uid provided by the server for files and directories and to always assign the owner to be the value of the uid= option. 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 gid 0. The mount.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.

forcegid instructs the client to ignore any gid provided by the server for files and directories and to always assign the owner to be the value of the gid= option. See the section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more information.

Parece que você quer algo semelhante a este

mount -t cifs -o username=xxx,password=xxx,file_mode=0777,dir_mode=0777 //server/share /mnt

Ou você pode restringi-lo a um usuário específico com algo como este

mount -t cifs -o username=xxx,password=xxx,uid=1000,gid=1000 //server/share /mnt
    
por 01.08.2016 / 09:23