View previous topic :: View next topic |
Author |
Message |
dasPaul Apprentice
Joined: 14 Feb 2012 Posts: 243 Location: Dresden
|
Posted: Sun Nov 21, 2021 10:32 am Post subject: Simple passwordless samba share [Solved] |
|
|
Hi
Looking for a Samba specialist.
I am driving to total despair in setting up a simple samba share (on a Linux-Server) that shall be passwordless read/write accessible from a Windows and a Linux client.
Situation on the server:
created share directory at /mnt/store/smbp:
Code: |
sudo mkdir /mnt/store/smbp
sudo chmod -R 0777 /mnt/store/smbp
sudo chown -R p:users /mnt/store/smbp
ls -lah /mnt/store/smbp
total 8.0K
drwxrwxrwx 2 p users 4.0K Nov 21 11:22 .
|
smb.conf:
Code: | [global]
security = user
workgroup = WORKGROUP
map to guest = bad user
[foo]
path = /mnt/store/smbp
writeable = yes
guest ok = yes
guest only = yes |
Situation on the Client:
If I then try to mount the share on my Linux-Client and create a new directory in it, I get this:
Code: | sudo mount //mimas/foo /mnt/u
Password for root@//mimas/foo:[ENTER]
mkdir /mnt/u/test
mkdir: cannot create directory '/mnt/u/test': Permission denied
mount | grep /mnt/u
//mimas/foo on /mnt/u type cifs (rw,relatime,vers=3.1.1,cache=strict,username=root,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.21,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1) |
Any ideas? _________________ -=human without Windows®=-
sorry for my bad english!
Last edited by dasPaul on Sun Nov 21, 2021 11:49 am; edited 1 time in total |
|
Back to top |
|
|
dasPaul Apprentice
Joined: 14 Feb 2012 Posts: 243 Location: Dresden
|
Posted: Sun Nov 21, 2021 11:48 am Post subject: |
|
|
I think I got it solved.
I added "guest account = nobody" to global and "create mask = 0644" and "directory mask = 0755" to the share section:
Code: | [global]
security = user
workgroup = WORKGROUP
map to guest = bad user
guest account = nobody
[foo]
path = /mnt/store/smbp
writeable = yes
guest ok = yes
guest only = yes
browsable = yes
create mask = 0644
directory mask = 0755 |
Further, mounting the share on the client required the "guest" option along with the uid,gid option:
Code: | sudo mount -t smb3 -o guest,uid=p,gid=users //mimas/foo /mnt/u |
Because I did not specify the guest option it always promped for a password and then used the root-user because mount uses sudo. The mounted mountpoint then always was owned by root:root, so I couldnt do anything with my normal user.
Setting explicitly the uid and gid possibly did the trick too. The mountpoint now has the ownership of that user/group. Files/directories created in that mountpoint of cause
get converted on the server to user/group "nobody".
The same share works flawlessly under Windows10. _________________ -=human without Windows®=-
sorry for my bad english! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|