Score:0

Samba between 2 ubuntu systems is one-way only

in flag

I am having a problem with my samba configuration.

I have an ubuntu system, let's name it A, that had ubuntu 16.04 until recently and now has ubuntu 20.04. This A computer was connected to a second one, let's name it B, with ubuntu 18.04, via samba (among other ways) to copy files between those systems.

I had several folders in each system and everything worked fine while in 16.04

After the format and the transition to ubuntu 20.04 the connection is now one-way only. More specifically, B cannot see any folder in A anymore. The folders appear shared in Files though. On the other hand, when accessing the shared folders in B from A everything works fine. I have tried some solutions but nothing seems to solve my problem (obviously I am missing something here).

In my samba conf file (/etc/samba/smb.cfg) for example, in both systems, I have this on my [global] section

   workgroup = WORKGROUP
   client min protocol = NT1
   server min protocol = NT1

which was the solution proposed at a question. It helped me to not get an actual error when accessing my shared folder from B but it does not actually display any shared folder (there is just an empty folder).

My final attempt was the instructions using from this site:

where an anonymous share was (theoretically) being shared by adding:

[Anonymous]

path = /samba/anonymous
browsable = yes
writable = yes
read only = no
force user = nobody

under the #======================= Share Definitions ======================= in A system only.

This created a folder, named Anonymous, when viewed from B in shared folders but I cannot really access it. It requires a password but it does not take any. Neither samba nor the user password. Anyway, it points to a non existing folder in my system (I have tried with an existing one nothing changes) but it doesn't seem so handy if I have to apply this for every shared folder.

So, does anyone have any idea how to properly share some folder between 2 ubuntu systems? As far as I know samba and samba client are installed on both systems.

Edit (after some comment request from @Morbious1):

$testparm -s

Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
    client min protocol = NT1
    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 min protocol = NT1
    server role = standalone server
    server string = %h server (Samba, Ubuntu)
    unix password sync = Yes
    usershare allow guests = Yes
    usershare owner only = No
    idmap config * : backend = tdb


[Anonymous]
    force user = nobody
    path = /home/gorfanidis/share_testing
    read only = No


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


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

and

$net usershare info --long

[python_projects]
path=/home/xxxx/python_projects
comment=
usershare_acl=Everyone:F,
guest_ok=y

[misc_cerberus]
path=/home/xxxx/misc
comment=
usershare_acl=Everyone:F,
guest_ok=y

[EfficientDet]
path=/home/xxxx/python_projects/EfficientDet
comment=
usershare_acl=Everyone:F,
guest_ok=n

[surveillance object detection]
path=/home/xxxx/Datasets/surveillance object detection
comment=
usershare_acl=Everyone:F,
guest_ok=n
David avatar
cn flag
-This created a folder, named Anonymous,- It created a share of that name because you told it to. The name of the last segment in your question [Anonymous]. If you change that name it will change the share that is seen.
Eypros avatar
in flag
Yeah, I get that it's named after that [Anonymous] tag but this only refers to how it will be displayed the folder name. It doesn't affect its contents.
Morbius1 avatar
es flag
That is not an anonymous share. It specifically requires a credentialed user to gain access. Plus since there is a force user added to the share definition even a credentialed user would be denied access unless the permissions on the /samba/anonymous folder was set to owner = nobody. It's a very bad Samba Howto. Why not post the output of the following commands to your question: `testparm -s` and `net usershare info --long`
Eypros avatar
in flag
@Morbius1 it certainly feels like a credentiated shared folder. I have added the output of the commands you mentioned.
Morbius1 avatar
es flag
There is noting wrong with your samba usershares as long as that users home directory isn't encrypted. For your [Anonymous] share change your force user to: `force user = gorfanidis` and allow guest access by adding `guest ok = yes` And don't forget to restart smbd after editing smb.conf: `sudo service smbd restart`
Eypros avatar
in flag
ok this seems to work. But it's a step back from making it work automatically from Files (nautilus). Is there a way to achieve this? Also, if you want to make it an answer I could accept it if you are interested.
Score:1
es flag

The HowTo you followed said that this share definition allows guest access:

[Anonymous]
    force user = nobody
    path = /home/gorfanidis/share_testing
    read only = No

It does the opposite.

To make it guest accessible and to make sure there are no Linux permissions issues I would suggest the following changes:

[Anonymous]
    force user = gorfanidis
    path = /home/gorfanidis/share_testing
    read only = No
    guest ok = yes

ok this seems to work. But it's a step back from making it work automatically from Files (nautilus). Is there a way to achieve this?

If this is a single user system what you could do is add force user = gorfanidis to the [global] section of smb.conf - right under workgroup = WORKGROUP is where I would put it. Then it would apply to all shares you create regardless of how you create them.

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.