help request samba share Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
jives
Posts: 25
Joined: Fri Apr 24, 2020 4:46 pm
Location: Netherlands,Eindhoven

help request samba share

Post by jives »

i have webmin running on my odroid HC1
i made a share but i am unable to write on it
my config file:

[global]
security = user
max log size = 1000
panic action = /usr/share/samba/panic-action %d
syslog = 0
syslog only = no
server string = %h server
workgroup = ENTERPRISE
pam password change = yes
obey pam restrictions = yes
printcap name = /dev/null
passdb backend = tdbsam
load printers = no
log file = /var/log/samba/log.%m
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
encrypt passwords = true
disable spoolss = yes
unix password sync = yes
os level = 20
map to guest = bad user
dns proxy = no
passwd program = /usr/bin/passwd %u

[dietpi]
max connections = 16
valid users = dietpi,perco
create mode = 775
directory mode = 775
path = /mnt/dietpi_userdata
write list = perco
comment = DietPi Share
writeable = yes

[Media]
create mode = 775
valid users = perco
writeable = yes
comment = HDDShare
path = /mnt/DietpiHDD
write list = perco
directory mode = 775

please some help with this
Attachments
current user.PNG
media share.PNG
user.PNG
User avatar
Joulinar
Posts: 2553
Joined: Sat Nov 16, 2019 12:49 am

Re: help request samba share

Post by Joulinar »

can you try to login as user perco on OS level (command line) and do the following

Code: Select all

touch /mnt/dietpi_userdata/test.file
touch /mnt/DietpiHDD/test.file
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
jives
Posts: 25
Joined: Fri Apr 24, 2020 4:46 pm
Location: Netherlands,Eindhoven

Re: help request samba share

Post by jives »

Both files seems to be empty when i open them as .txt
But....
i discovered that i can change permissions via File manager
did resolved my issue when i changed the check in the box others in 'write'

why this is not default when making shares i still don't know
Permissions.PNG
User avatar
Joulinar
Posts: 2553
Joined: Sat Nov 16, 2019 12:49 am

Re: help request samba share

Post by Joulinar »

yes files you are creating using touch are empty. It's just a test about permissions if the user is able to write down something on OS level.

But as I understood you found the correct setting and now able to write files using SAMBA?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
jives
Posts: 25
Joined: Fri Apr 24, 2020 4:46 pm
Location: Netherlands,Eindhoven

Re: help request samba share

Post by jives »

Yep, i've learned today
but i am still confused why the configuration thrue Webmin didn't (completely) work

anyway, i hope this post helps someone in the future
User avatar
Joulinar
Posts: 2553
Joined: Sat Nov 16, 2019 12:49 am

Re: help request samba share

Post by Joulinar »

Well Webmin is working as designed. The thing is that these are 2 different topic. On Webmin you managed and configured the SAMBA access. However in addition to that, you would need to ensure that the samba user is able to write to the files/directories. This is a pure access/permission topic an not something that will be managed due to a samba configuration.

By default access to specific folder/files is given to the owner of these folder/files only, to protect not authorized activities. On /mnt directories usually DietPi user is the owner. Same for mounts of external devices. To give access to someone else, like a different "samba" user, you usually add these user to the same group and add write permission for that group. This way you still have protected the files to be accessed by everybody. In your case, what you have done now is to grant permission to everybody. This is the easiest way but not the moste secure. However, if you can ensure that your system can't be accessed by someone else from outside world, you should be fine. ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply