adding Samba user not possible

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
karl
Posts: 7
Joined: Fri Feb 12, 2021 8:41 am

adding Samba user not possible

Post by karl »

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
User avatar
Joulinar
Posts: 3688
Joined: Sat Nov 16, 2019 12:49 am

Re: adding Samba user not possible

Post by Joulinar »

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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
karl
Posts: 7
Joined: Fri Feb 12, 2021 8:41 am

Re: adding Samba user not possible

Post by karl »

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
User avatar
Joulinar
Posts: 3688
Joined: Sat Nov 16, 2019 12:49 am

Re: adding Samba user not possible

Post by Joulinar »

I guess you samba export is still default /mnt/dietpi_userdata. Let's check permissons ls -la /mnt/dietpi_userdata
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
karl
Posts: 7
Joined: Fri Feb 12, 2021 8:41 am

Re: adding Samba user not possible

Post by karl »

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
User avatar
Joulinar
Posts: 3688
Joined: Sat Nov 16, 2019 12:49 am

Re: adding Samba user not possible

Post by Joulinar »

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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
karl
Posts: 7
Joined: Fri Feb 12, 2021 8:41 am

Re: adding Samba user not possible

Post by karl »

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
Attachments
timeout.png
User avatar
Joulinar
Posts: 3688
Joined: Sat Nov 16, 2019 12:49 am

Re: adding Samba user not possible

Post by Joulinar »

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

As well you can check messages from SAMBA serer

Code: Select all

journalctl -u nmbd
journalctl -u smbd
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
karl
Posts: 7
Joined: Fri Feb 12, 2021 8:41 am

Re: adding Samba user not possible

Post by karl »

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
User avatar
Joulinar
Posts: 3688
Joined: Sat Nov 16, 2019 12:49 am

Re: adding Samba user not possible

Post by Joulinar »

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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply