Score:0

how to make Ubuntu 20.04 give guest permissions for local file share to windows 10

cn flag

so far i have a file share set up and ive gotten to the point where it is now discoverable on my windows 10 pc by adding a wsdd service (i think thats what i did anyway. mostly just following tutorials online cause i dont understand very much yet. im getting there tho.)

so at this point i can now see and open the network location and am able to see the shared folders inside the network folder. when i click on the shared folders i windows yells at me and says: windows cannot access: you do not have permission to access this drive.

on the share i have guest access enabled and allow others to create and delete also enabled. at this point it should just work right? but its not. how do i fix this? ive had shares set up on other versions before accessed by the same pc which has not changed but they all broke with the update so i completely reformatted and reinstalled a fresh version of ubuntu. i have done nothing except for this and web browsing since the reinstall

sony@Cher:~$ testparm -s
--------------------------
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
    log file = /var/log/samba/log.%m
    logging = file
    map to guest = Bad User
    max log size = 1000
    obey pam restrictions = Yes
    pam password change = Yes
    panic action = /usr/share/samba/panic-action %d
    passwd chat = Enter\snew\s\spassword:* %n\n Retype\snew\s\spassword:* %n\n password\supdated\ssuccessfully .
    passwd program = /usr/bin/passwd %u
    server role = standalone server
    server string = %h server (Samba, Ubuntu)
    unix password sync = Yes
    usershare allow guests = Yes
    idmap config * : backend = tdb


[printers]
    browseable = No
    comment = All Printers
    create mask = 0700
    path = /var/spool/samba
    printable = Yes


[print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers



sony@Cher:~$ net usershare info --long
[Seagate Expansion Drive]
path=/media/sony/Seagate Expansion Drive
comment=
usershare_acl=Everyone:F,
guest_ok=y
Morbius1 avatar
es flag
Please edit your post and add the output of the following commands: `testparm -s`AND `net usershare info --long`
Korbel avatar
cn flag
@Morbius1 there you are! :)
Score:0
es flag

sony appears to be a user name.

The problem here isn't a samba issue it's a Linux permissions issue.

By default Linux places special permissions on /media/$USER ( /media/sony in this case ) such that only that user ( sony ) can get to whatever is past it. A samba guest user is not sony so Linux gives you a permissions denied error and samba passes that error on to the client.

You can use samba to get around this problem especially since you only have one share and that is to edit /etc/samba/smb.conf and right under the workgroup = WORKGROUP line add this one:

force user = sony

Then restart smbd: sudo service smbd restart

The samba guest user will be converted to sony - at least for this samba share.

Korbel avatar
cn flag
thanks so much! everything i found that told me to edit permissions wanted me to rip apart what felt like half the os. this is such a simple and seemingly elegant solution.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.