adding Samba user not possible

At first I want to say a big Thank you for this great Distro… Its more than a Distro it’s an amazing project.
I use DietPi ti run Samba, Plex and PiHole on a Raspi and it works great … nearly.

My last problem. I can’t copy files on the external Harddisk mounted on Raspi.

On my Linux Workstation I am “Karl”
On my DietPi I am “DietPi”

So I thought to add a new user “Karl” with smbpasswd -a Karl
This works, but when asked for a password the System says “Failed to add entry for user karl.”

Of course I used “sudo”.

What can I do, to copy files from my Workstation to the Samba-Share.
Thanks in advance
Karl

Hi,

by default SAMBA share access is done using user dietpi

If you like to create/use a different user, you might need to do following

  1. add a new user on OS level
  2. assign a SAMBA password to that user
  3. adjust SAMBA config to allow this user
  4. check SAMBA export on OS level to ensure proper ownership for that user

Thanks a lot for your quick answer

I added now the user “karl” on DietPi and gave him the same PW as on my Workstation.
Then I did a “smbpasswd -a karl”
then I added this user in the smb.conf → valid users = dietpi,karl

Now I can connect with both users to dietpi and karl to my Samba-Servers - but I’m still not allowed to copy files

What means your last point "check SAMBA export on OS level to ensure proper ownership for that " ?
KR Karl

I guess you samba export is still default /mnt/dietpi_userdata. Let’s check permissons ls -la /mnt/dietpi_userdata

root@DietPi:/# ls -la /mnt/dietpi_userdata
insgesamt 24
drwxrwxr-x 6 dietpi dietpi 4096 Jän 26 15:19 .
drwxr-xr-x 8 root root 4096 Jän 27 11:47 …
drwxrwxr-x 2 dietpi dietpi 4096 Jän 26 15:19 downloads
drwxrwxr-x 2 dietpi dietpi 4096 Jän 26 15:31 Music
drwxrwxr-x 2 dietpi dietpi 4096 Jän 26 15:19 Pictures
drwxrwxr-x 2 dietpi dietpi 4096 Jän 26 15:19 Video

the folder and files are owned by user dietpi. Means your newly created user is not allowed to access them. You can now change ownership for your new user, or allow access for everyone or you add your new user to dietpi user group

Thanks a lot. This was the issue. I have now rights to write in this directroy.
Next topic: If I want to copy huge video files I run into a timeout after a short time.

Any idea where I can screw??

many thanks
Karl

P.S.
Where are you from? I’m from Vienna
timeout.png

does it fail after same time always or does it varies??

As well you can check messages from SAMBA serer

journalctl -u nmbd
journalctl -u smbd

nmbd.log shows
[2021/02/14 10:29:32.658301, 0] …/source3/nmbd/nmbd_namequery.c:109(query_name_response)
query_name_response: Multiple (2) responses received for a query on subnet 192.168.0.55 for name WORKGROUP<1d>.
This response was from IP 192.168.0.185, reporting an IP address of 192.168.0.185.
[2021/02/14 10:34:33.153335, 0] …/source3/nmbd/nmbd_namequery.c:109(query_name_response)

where 192.168.0.185 is my Mint-Desktop …and 55 is the Dietpi-Raspi

smbd.log shows
[2021/02/14 10:52:14.543427, 0] …/lib/util/become_daemon.c:138(daemon_ready)
daemon_ready: STATUS=daemon ‘smbd’ finished starting up and ready to serve connections

all other logs notabl 192.168.0.185 are O / zero bytes big.
BR
Karl

timeout is always very short after beginning… creating a new directory works, but after 260 - 560 kb the process interrupts

if connection fail short after download start, it can’t be a timeout. probably network connection drops. Is you system connected via ethernet or wifi? You could have a look for kernel messages if there is an issue indicated dmesg -l err,crit,alert,emerg

Hi Joulinar

Problem is solved. I hat a “bad” line in smb.conf (create mask = 0664)
Since I commented this line out,every copying works fine…

We can close this issue now. Thanks for your help. DietPi is a great project
KR
Karl

that’s strange, usually this value specify the permissions used to create files on the samba share, nothing else.

hmm… but: when -as you’re writting- this setting controls the write permission, due to my understanding it is logical, that this is an essential point to control… when I copy a directory from A to B and it is still not available on B… the first thing is, that it will be created. And this creation is a form of writting???
Isn’t that true?

You see I’m far away from a Linux guru - I only have my common sense-

BR
Karl

well the value is defining the permissions on which a directory is newly created. 664 means r/w permission for the creator.