Score:0

Access to shared folder failing

cn flag
Dan

I'm trying to set up a shared folder so that only a specific user (steve) can access. Steve is the only user on my machine and the share is set up using Steve's account.

The share is set up like

enter image description here

On my local Ubuntu Desktop 21.04 machine, when I navigate to Other Locations, double click on my local machine's name under Networks, and double click the Test folder, it says Authentication Required.

I click Registered User, type Steve's password in, and it just re-opens the Authentication Required required window as if I wasn't authenticated.

ls -la says the permissions for the folder are:

drwxrwxrwx  1 steve    steve     0 Aug 28 19:02  Test

Have I missed something when setting up the folder share?


Not sure if it makes any difference, but Test is on an external HDD. Also, I presume it uses Samba but I'm not sure.

When trying to access the shared network folder using a Windows machine, I also get the authentication window. I type in Steve's details, and it says authentication failed.

ar flag
What do you mean by "I'm trying to access a shared folder **on my machine using my machine**"? Are you trying to access the shared folder from the same machine as a different user? Are you trying from the same (dual boot) machine after booting Windows? Or do you have two machines, and both are called "my machine"? See [this answer](https://askubuntu.com/questions/310180/how-to-share-files-through-the-local-network/310201#310201) for some information on using shared folder.
ar flag
If you want to share a folder between two local users, say Dan and Doll, in a single Ubuntu computer, then see [this answer](https://askubuntu.com/questions/291501/share-a-folder-between-two-local-users/291657#291657).
Dan avatar
cn flag
Dan
@user68186 Sorry for miscommunication. I'm trying to access the network share folder on the machine that has shared the folder. However, I'm accessing it through the `Networks` section rather than accessing it directly. Also, I'm not trying to share it between different users, just want to access it with my own account, but it seems to be denying it. Thanks for the links, will have a look now
waltinator avatar
it flag
Please [edit] your post to add new information, properly formatted. Information added via comments is hard for you to format, hard for us to read and ignored by future readers. Please click [edit] and add that vital information to your question so all the facts we need are in the question. Please don't use Add Comment, since that's our uplink to you. All facts about your system should go in the Question with [edit]
Dan avatar
cn flag
Dan
@waltinator The question has been updated to hopefully rule out any confusion. Please let me know if it requires any more information
Score:0
cn flag
Dan

Turns out there was quite a lot I hadn't done. It wasn't as simple as installing Samba and setting up the folder share by right clicking on it.

I also had to:

  1. Create a samba user account for Steve: sudo smbpasswd -a steve

  2. Configure the smb.conf to set the security mode to user. Ran sudo gedit /etc/samba/smb.conf and added security = user under workgroup = WORKGROUP under the [global] section.

  3. Added a section to the smb.conf defining the information about the folder I wanted to share.

    [Test]
        path = "/media/steve/external drive/Test"
        read only = no
        writeable = yes
        browseable = yes
        valid users = steve
        create mask = 0777
        directory mask = 0777
    
  4. Restarted the smb service by running sudo service smbd restart

I can now access the shared folder both locally through the Networks section and on other machines.


For each folder you want to share, you need to define a section like the 3rd point shows and then restart the service like the 4th point shows

Morbius1 avatar
es flag
You might want to remove the share you created in Nautilus since it is different than the one you created in smb.conf. The nautilus share allows anyone with a samba password access to the share not just the one. You can remove the share through nautilus or by deleting the "test" file under /var/lib/samba/usershares.
Dan avatar
cn flag
Dan
@Morbius1 Is that the GUI bit I showed in the question?
Morbius1 avatar
es flag
Yes. It uses a package called nautilus-share that creates a samba usershare at /var/lib/samba/usershares. It's different from the "classic" samba shares created in smb.conf. Samba can get confused if you share the same folder using both methods.
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.