I am sharing a folder on my linux mint machine with an ubunut machine and two windows machines on my home network, pluss one windows machine accessing the share through sftp over the internet.

The folder is stored under user 1's home directory on the linux mint, but most of the files are created and modified by the windows machines.

The problems we are facing is that we very often only get to open the files in read only, which of course is very annoying if you need to edit the file.
Sometimes it seem like a random thing whether you will be able to edit at a certain time or not, and sometimes even, if you close and reopen the file you may be able to edit it, and it is not because somebody else is having the file open

The first thing I would do is fix this since it's not a good idea to create a samba share using 2 different methods on the same target folder:

I also set the folders to share in nautilus, but using samba perhaps I could just remove this? Could it be creating some kind of conflict with samba, perhaps?

Creating a share via Nautilus is creating a samba share - called a Samba Usershare - and it's share definition is located ar /var/lib/samba/usershares. Since you already have a share defined in smb.conf - Called a Samba Classic Share - you may indeed have a conflict. For what you are attemping to do you could remove the classic share from smb.conf and add the "force user = user1" line to the [global] section - right under the workgroup line - then restart samba.

If that doesn't resolve the issue post the output of the following commands:

I have tried to remove the sharing through nautilus, by going right-click on the folder and to share and remove the tick, but the system sets it right back again. I have tried with the root account too, but that account does not even have the option to remove the share.

Could I just to into the /var/lib/samba/usershares and clear out the files in there, perhaps?

I ran the commands you said and the output does not look good, does it?
Also just today I started getting the error you see on the very top just when I open the terminal:
---------
bash: /usr/bin/mint-fortune: No such file or directory

user1@Mint ~ $ net usershare info --long
info_fn: file /var/lib/samba/usershares/factura&pagos is not a well formed usershare file.
info_fn: Error was Path is not a directory.
info_fn: file /var/lib/samba/usershares/iva_21 is not a well formed usershare file.
info_fn: Error was Path is not a directory.
info_fn: file /var/lib/samba/usershares/nominas is not a well formed usershare file.
info_fn: Error was Path is not a directory.
[MM]
path=/home/user1/Downloads/MM
comment=
usershare_acl=Everyone:F,
guest_ok=n

info_fn: file /var/lib/samba/usershares/pagos is not a well formed usershare file.
info_fn: Error was Path is not a directory.
[curris]
path=/home/user1/Downloads/MM/curris
comment=
usershare_acl=Everyone:R,USER1\(null):F,
guest_ok=n

You have a classic share ( "shared data" @ /home/user1/Downloads ) that allows full access to guests.

You have a whole bunch of usershares based off subdirectories of /home/user1/Downloads that do not allow guests - for example: "MM" @ /home/user1/Downloads/MM . If I were to find myself on your network, do not have a samba password, and therefore a guest it's true that I cannot access the MM share but I can access the /home/user1/Downloads/MM folder through the "shared data" share.

Likewise, all these shares that are created off subdirectories of /home/user1/Downloads/MM are redundant since access to the MM share grants me access to all of it's content.

I'm not sure what you are trying to achieve with this set up. Do you want users to authenticate or not?

Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

the nautilus shares I tried to set up as I would have done on a windows machine. But then I found that samba would probably be more suitable for my needs. So if possible I would like to turn off the shares created through nautilus and only use samba share and sftp access for the user accessing through internet.

The user accessing through internet (user2) only needs to access the MM folder. I would like the linux and windows computers on the home network to access the Downloads and the MM folder (currently store within the Downloads folder).

The user accessing through internet has to authenticate with correct username and password. When accessing over the home network I would like to be able to access without having to authenticate.

the nautilus shares I tried to set up as I would have done on a windows machine. But then I found that samba would probably be more suitable for my needs.

The shares you created through Nautilus are samba shares. If you don't want them anymore and since you have so many just go to /var/lib/samba/usershares and delete the definition files you see there.

I would like the linux and windows computers on the home network to access the Downloads and the MM folder (currently store within the Downloads folder).... When accessing over the home network I would like to be able to access without having to authenticate.

Every user on your local network has read/write access to the /home/user1/Downloads folder and all of it's contents including but not restricted to the MM folder. You can't share the Downloads folder without sharing everything within it.

As far as your sftp question I would start another thread. I did this once so long ago I don't even remember where I was living at the time. I just remember that it involved port forwarding and something about chroot'ing.

Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.