dperson / samba

Samba docker container
GNU Affero General Public License v3.0
1.52k stars 514 forks source link

Samba server on Kubernetes #431

Closed alice36 closed 1 year ago

alice36 commented 1 year ago

I created deployment of samba server using these manifests:

https://github.com/kubernetes-csi/csi-driver-smb/tree/master/deploy/example/smb-provisioner

but I received on pod below logs:

usermod: /etc/passwd.8: Permission denied
usermod: cannot lock /etc/passwd; try again later.
groupmod: /etc/group.9: Permission denied
groupmod: cannot lock /etc/group; try again later.
adduser: permission denied (are you root?)
When run by root:
smbpasswd [options] [username]
otherwise:
smbpasswd [options]
options:
-L local mode (must be first option)
-h print this usage message
-s use stdin for password prompt
-c smb.conf file Use the given path to the smb.conf file
-D LEVEL debug level
-r MACHINE remote machine
-U USER remote username (e.g. SAM/user)
extra options when run by root or in local mode:
-a add user
-d disable user
-e enable user
-i interdomain trust account
-m machine trust account
-n set no password
-W use stdin ldap admin password
-w PASSWORD ldap admin password
-x delete user
-R ORDER name resolve order
sed: can't create temp file '/etc/samba/smb.confXXXXXX': Permission denied
/usr/bin/samba.sh: line 121: /etc/samba/smb.conf: Permission denied
/usr/bin/samba.sh: line 122: /etc/samba/smb.conf: Permission denied
/usr/bin/samba.sh: line 123: /etc/samba/smb.conf: Permission denied

how to increase privileges on this container to make this work?

TobiTomson commented 1 year ago

Hi @alice36, Maybe you have in the meantime resolved your issue. I am not quite sure why you posted this question as an issue on this repo, as the manifests you link don't have anything to do with dperson/samba. So the problems you are having have nothing to do with this repo, and this issue should be closed.

However to maybe give you a hint: The errors you are getting are indicating that the security context of the pod are not allowing some operation that the process is trying to execute. You might want to familiarize yourself with security contexts: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/. Hope that helps.

alice36 commented 1 year ago

Hi, this manifest is using dperson/samba (https://github.com/kubernetes-csi/csi-driver-smb/blob/master/deploy/example/smb-provisioner/smb-server-networkdisk.yaml) but yes - it was kubernetes setting problem not with the image itself, thanks!