viewtopic.php?p=2159680#p2159680
GOALS OF THIS TUTORIAL Starting from the freshly installed machines with: Linux Mint 20.2 Cinnamon and with MATE (in this example those are also Virtual Machines on VirtualBox) I want to demonstrate many issues related to Folder Sharing from and External USB HDD
In all the examples the User Account Name is: testuser
PC Names shall be: Mint-20C for Cinnamon and Mint-20M for Mint with MATE Desktop
You can check your PC Name by typing in Terminal (Ctrl + Alt + T)
Code: Select all
hostnamectl
Cinnamon
Code: Select all
testuser@Mint-20C:~$ hostnamectl
Static hostname: Mint-20C
Icon name: computer-vm
Chassis: vm
Machine ID: dafd9a61376b4676aa8b190bc1ed4b43
Boot ID: 1eb3e6417c884252aad8200f555dd8e7
Virtualization: oracle
Operating System: Linux Mint 20.2
Kernel: Linux 5.4.0-77-generic
Architecture: x86-64
Code: Select all
testuser@Mint-20M:~$ hostnamectl
Static hostname: Mint-20M
Icon name: computer-vm
Chassis: vm
Machine ID: 7a0781c5129d4f848f901e53f906eaf1
Boot ID: de77013437c845bc946a64aace893a80
Virtualization: oracle
Operating System: Linux Mint 20.2
Kernel: Linux 5.4.0-77-generic
Architecture: x86-64
Code: Select all
hostnamectl set-hostname <New-Name>
Concrete TASKS
1. Install necessary software
2. Set properly all kinds of permissions regarding samba and samba users. Set one Group of Users with name homeusers in our example we shall use john and mary
3. Explain how to properly mount HDD with respect to the Folder Sharing Goals
4. Set sharing of Folders (all on External USB HDD): Folder A, Folder B and Folder C so that
a) Folder A can only be accessed by testuser with all read-write-execute permissions applicable
b) Folder B can be accessed by testuser and by users from Group homeusers, all read-write-execute permissions applicable
c) Folder C can be accessed by testuser with all permissions and also by a Guest/Anonymous User but only with read and execute permissions, i.e. no possibility to write/delete.
5. Demonstrate proper access to these shared folders from various OSs, both through PCs Network IP Address and through its Symbolic PC Name where possible. Also explain how to improve visibility of Network Shared Folders between other Debian based PCs and with Win10 on a home Network.
As much as possible I will use GUIs, but still there is work to be done through Terminal as well. As for text editor I will use xed as it is default editor in both Mint Cinnamon and Mint MATE. In order to more easily follow this tutorial please first time you open something with xed go to Edit>Preferences>Editing and check 'Display line numbers'
So you should adjust in your own case testuser, homeusers, john, mary, hostnames, ip addresses, Folder Names as per your own case
I strongly recommend, if possible, to first experiment on a Virtual Machine and/or to create Timeshift image before you start. If your home Internet Server does not provide always same IP address for an individual PC (usually DHCP based on a MAC address of a PC), than symbolic names should be the only available option for accessing Shared Folders. Still it is way better to have DHCP server assigning always same local IP addresses based on MACs since Win7 won't be able in many cases to access shared folder through PC hostname.
For the purposes of this tutorial I am using Virtual Machines, but with Bridged Network Adapters, so the VMs are on the same Ethernet Network as all the other PCs and Android Devices and this doesn't in any way limit applicability of this tutorial. IP address set for this tutorial are 10.1.3.62 for Mint Cinnamon and 10.1.3.64 for Mint Mate.
My motivation for writing these tutorials is that when 20 months ago I switched from Win7 to Linux Mint 19.2 I needed immediately to learn about Folder Sharing. There were many available tutorials, almost exclusively covering the easiest cases of Folders being on PCs System Disk, especially on one's home folders, but there was none that actually explained how do you share something that is on another hard drive, especially if that is external USB HDD. So I am offering here the result of my 20-months long search into Network Folder Sharing. Hope this helps someone, especially the Linux newbies, since it is way more complex than usually presented.
EXPLANATION FOR LINUX MINT 20.2 WITH CINNAMON AND WITH MATE DESKTOP I shall now proceed with explanation with examples illustrated on Linux Mint 20.2 Cinnamon and MATE machines freshly installed for the purposes of this tutorial.
CHAPTER 1 Installation of additional applications for samba functionality and Network shares diagnosing a) for Cinnamon Desktop
We will first install samba. We also need cifs-utils (pre-installed on both Desktops), nemo-share (on Cinnamon, also pre-installed) and caja-share (On Mate, it is not pre-installed)
Open Terminal (easiest way by pressing together Alt + Ctrl + T) and type
Code: Select all
sudo apt install samba
b) For MATE
Open Terminal and type
Code: Select all
sudo apt install samba caja-share
This should be everything we need for this tutorial
CHAPTER 2 INITIAL SAMBA SETTINGS AND SAMBA USERS Much of this chapter and the tutorial as well is based on the following article
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-samba-share-for-a-small-organization-on-ubuntu-16-04
Still, we will adjust it as to cover our tasks set for this tutorial. Also, we will not use already existing group sambashares, but rather create our own group homeusers
2.1 BackUp of Samba Configuration File
It is always recommended to save a backup of initial samba configuration file, just in case, and verify that it has been done. So type in terminal (Both Cinnamon and MATE)
Code: Select all
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.initial
ls -l /etc/samba/
Code: Select all
testuser@Mint-20M:~$ ls -l /etc/samba/
total 32
-rw-r--r-- 1 root root 8 Apr 14 13:02 gdbcommands
-rw-r--r-- 1 root root 8942 Jul 20 11:28 smb.conf
-rw-r--r-- 1 root root 8942 Jul 20 12:42 smb.conf.initial
drwxr-xr-x 2 root root 4096 Apr 14 13:02 tls
Code: Select all
ip link show
From now on unless specified differently everything will apply to both Cinnamon and Mate Desktops.
Let us now open samba configuration file in the default editor. Like mentioned earlier you may now want to activate Display of Line numbers.
Type in Terminal
Code: Select all
sudo xed /etc/samba/smb.conf
If you have never read anything about Folder/File Permissions in Linux I would recommend following link
https://help.ubuntu.com/community/FilePermissions
File creation mask and Directory creation mask need to cover all of our tasks. Later on we will limit what is too much of a permission for a particular Folder share
First digit is of no interest to us.
Second digit (by default it is 7) refers to maximum read(4)+write(2)+execute(1)=7 permissions for the file owner. It will remain as it is 7.
Third digit (by default it is 0) refers to the users belonging to group to which this folder belongs. Since for Folder B we want to grant all the permissions to our group: homeusers, we will need here 7 as well. On another level we will then reduce this for folders A and C.
Fourth digit refers to Guest/Anonymous Users (by default it is 0). In our case for Folder C we want to grant access to Guest Users for read (4)+execute(1)=5
As a conclusion we will change both create mask and directory mask to 0775
Please, do so and replace 0700 in lines 185 and 189 to 0775. As was stated earlier you may also want to add or replace eth0 with your own interface like enp0s8 or what ever output you got when typing IP link show in Terminal. Click on the Save button and close Text Editor. Don't worry about the warning you get in your Terminal. Changes will take effect once we restart samba. Right now there is still more job to be done so it could wait.
2.3 Samba User Folders
2.3.1 Samba 'Root' Folder
In the above mentioned link Folders for Network Share were placed in new /samba/ Folder directly on the root. Here we will place these folders in /media/samba/ instead. So I am preparing the scenario to match the one from the tutorial by first assuring permissions for /media/ to be the same as for root folder '/'. In terminal type
Code: Select all
sudo chown root:root /media/
sudo chmod 755 /media/
Code: Select all
getfacl /media/
Code: Select all
testuser@Mint-20M:~$ sudo chown root:root /media/
[sudo] password for testuser:
testuser@Mint-20M:~$ sudo chmod 755 /media/
testuser@Mint-20M:~$ getfacl /media/
getfacl: Removing leading '/' from absolute path names
# file: media/
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
Let us now see what is with our original Folder /media/testuser/ where non-System HDDs are usually mounted by default.
2.3.2 Normal Folder for default Mounting of non-System HDDs
Type in Terminal
Code: Select all
sudo chown testuser:testuser /media/testuser/
getfacl /media/testuser/
Code: Select all
testuser@Mint-20C:~$ sudo chown testuser:testuser /media/testuser/
testuser@Mint-20C:~$ getfacl /media/testuser/
getfacl: Removing leading '/' from absolute path names
# file: media/testuser/
# owner: testuser
# group: testuser
user::rwx
user:testuser:r-x
group::---
mask::r-x
other::---
type in Terminal
Code: Select all
setfacl -bn /media/testuser/
sudo chmod 775 /media/testuser/
getfacl /media/testuser/
Now you will see an output like this
Code: Select all
getfacl: Removing leading '/' from absolute path names
# file: media/testuser/
# owner: testuser
# group: testuser
user::rwx
group::rwx
other::r-x
https://unix.stackexchange.com/questions/339765/how-to-remove-acl-from-a-directory-and-back-to-usual-access-control
So, what ever you might now mount in your default folder for non-System HDDs should be now way more easier to share over local Network especially for situations like in our cases for folders A and C.
2.4 Finally, Samba Folder
We need Samba 'root' Folder (if I am allowed to call it like this) so that samba shares could be functional.
Type in Terminal
Code: Select all
sudo mkdir /media/samba/
sudo chown :sambashare /media/samba/
Code: Select all
getfacl /media/samba/
Code: Select all
getfacl: Removing leading '/' from absolute path names
# file: media/samba/
# owner: root
# group: sambashare
user::rwx
group::r-x
other::r-x
For purposes of Sharing Task for Folder B we need a group of users belonging to the new group homeusers
Type in Terminal
Code: Select all
sudo addgroup homeusers
Code: Select all
Adding group `homeusers' (GID 1001) ...
Done.
2.6 Adding samba share users to the new group 'homeusers'
2.6.1 Adding of user 'john'
Let us now add the first user 'john' and at the same time add him to the group homeusers
a. Type in Terminal
Code: Select all
sudo mkdir /media/samba/john
b. next type in Terminal
Code: Select all
sudo adduser --home /media/samba/john --no-create-home --shell /usr/sbin/nologin --ingroup homeusers john
Code: Select all
Adding user `john' ...
Adding new user `john' (1001) with group `homeusers' ...
Not creating home directory `/media/samba/john'.
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for john
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
Code: Select all
id john
Code: Select all
uid=1001(john) gid=1001(homeusers) groups=1001(homeusers)
c. The first mentioned tutorial suggests that we 'round up' this folder for john, so please also type
Code: Select all
sudo chown john:homeusers /media/samba/john/
sudo chmod 2770 /media/samba/john/
2.6.2 Adding user 'mary'
Now let us do the same for user mary In terminal type same as for john just replacing everywhere with mary.
Code: Select all
sudo mkdir /media/samba/mary
sudo adduser --home /media/samba/mary --no-create-home --shell /usr/sbin/nologin --ingroup homeusers mary
sudo chown mary:homeusers /media/samba/mary/
sudo chmod 2770 /media/samba/mary/
Code: Select all
testuser@Mint-20C:~$ sudo mkdir /media/samba/mary
testuser@Mint-20C:~$ sudo adduser --home /media/samba/mary --no-create-home --shell /usr/sbin/nologin --ingroup homeusers mary
Adding user `mary' ...
Adding new user `mary' (1002) with group `homeusers' ...
Not creating home directory `/media/samba/mary'.
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for mary
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
testuser@Mint-20C:~$ sudo chown mary:homeusers /media/samba/mary/
testuser@Mint-20C:~$ sudo chmod 2770 /media/samba/mary/
Code: Select all
sudo smbpasswd -a john
Code: Select all
New SMB password:
Retype new SMB password:
Added user john.
Code: Select all
sudo smbpasswd -e john
Code: Select all
Enabled user john.
Code: Select all
sudo smbpasswd -a mary
sudo smbpasswd -e mary
2.8 Now we will finally prepare the Folder where our External USB HDD will be mounted and make the testuser its owner and the group homeusers as group owners
Type in terminal
Code: Select all
sudo mkdir /media/samba/common-shares/
sudo chmod 2775 /media/samba/common-shares/
Code: Select all
getfacl /media/samba/common-shares/
Code: Select all
getfacl: Removing leading '/' from absolute path names
# file: media/samba/common-shares/
# owner: testuser
# group: sambashare
# flags: -s-
user::rwx
group::rwx
other::r-x
2.9 Let us not forget that testuser also needs to be samba user, like john and mary, and to have its own samba password
Code: Select all
sudo smbpasswd -a testuser
sudo smbpasswd -e testuser
CHAPTER 3 MOUNTING EXTERNAL USB HDD of a NTFS type so that you won’t have troubles sharing it
As was mentioned earlier most tutorials are based on sharing your Linux home folders, or home folders created in /samba/<username> or var/samba/<username>, which is all on your system disk and is way easier to organize and to change folder and file permissions, so when it comes to sharing data on your external HDD or even on a non-system internal HDD, which is normal medium where you would actually store and keep something, new Linux Users face a lot of frustrations of how to get the things going. Main issue here is that once you mount a HDD other then System HDD you can not actually change folder and file permissions, so chmod, chown, chgrp or modifications through file explorers are all ineffective. A top of everything there are rules for Parent Folders than can apply to all the subfolders, as well as some ACL permissions. An entire mine field for a newbie.
So let's start by opening application Disks (Press Super/Win key or menu icon at the bottom left corner of the screen, type disks and then click on the icon 'Disks'). It is installed by default in both Cinnamon and Mate Desktops so it is available out of the box.
Click on the USB External Disk icon at the left side of the application. In this case it is named DISK3, 125 GB DRIVE, SMI USB DISK, in your case it will be something else
Now click on Additional partition options and then click on Edit Mount Options …
You will see the default Mount Options like this
Turn off User Session Defaults, check Mount at system startup, change the line without any description (it refers to mounting options) to permissions,x-gvfs-show,uid=1000,gid=1001,suid,dmask=002,fmask=002,nofail
Mount Point field change to /media/samba/common-shares/DISK3
Filesystem Type change to ntfs-3g
Leave 'Identify As' field as it is. Don’t change it by no means!
After that Mount Options should look like this
Click OK
Enter your SUDO password when asked for
Now un-mount and re-mount the disk, so that the changes would be effective. It is done by pressing the rectangle icon (like stop button on an old tape recorder) and than the play/triangle icon, that will be at the same location. Ultimately you will again see the rectangle icon meaning that your disk is mounted.
If you should face any difficulty with remounting make sure that you save and close any application using files related to the content on the disk, then simply unplug it from its USB port and then re-plug it. This will make all the changes effective.
Let us just briefly explain the mounting options used here:
-permissions - I am not exactly sure for this one, but I found it recommended by some posts on Internet so I keep it
x-gvfs-show - This is obligatory for NTFS files so that you could see them with File Explorer
uid=1000 - This says that owner is user with uid=1000 which is the default user, in our case that is testuser
gid=1001 - This says that group owners are from Group with identification 1001, In chapter 2.5 we got this number when we created group homeusers, so this group has group ownership.
suid - this option permits use of flag bits for owner and group, which are defined for the parent folder /media/samba/common-shares/ where we mounted our DISK3
dmask and fmask=002 By this we on the level of files and folders disable modification permission for Guest Users
nofail - if disk is unplugged no error message will be notified, once it is again plugged-in it will be simply mounted, so just a useful option
As was said initially, whenever possible I prefer to use GUI. Other possibility was to change directly /etc/fstab file. Still everything we did with Disks is now written in /etc/fstab so you may open this file and see how it looks. Still, disk identifier is way more easier to set with 'Disks', then to look up with Terminal, and then risk to mistype some character.
If you like to learn more about mounting a drive I would recommend this link
https://help.ubuntu.com/community/Fstab
CHAPTER 4 SETTING SHARING RULES FOR EACH INDIVIDUAL FOLDER
For this tutorial we have created on the mounted External USB HDD (or even a USB Memory Stick) three folders: 'Folder A', Folder B' and 'Folder C' and placed a few print screen images in each one of them.
4.1 Setting Folder A so that it can be accessed with full permissions only by its owner 'testuser'
Open your default File Browser (you can simply Press Super/Win + E).
Then when it opens click on the DISK3 icon at the left side of 'Files' window
When you see all the three folders listed (if you haven't done it earlier now add three folders: 'Folder A', Folder B', 'Folder C' and put some insignificant files in each one of them) right click, one by one, on each one of them and select 'Sharing options'. (If in MATE you don't see this option log-out then log-in. If you missed to install caja-share then do it now 'sudo apt install caja-share' log-out, log-in).
Folder A set like this
in Cinnamon
in MATE
Linux Mint is known for warning about Folder Share, even when everything is just fine, but don't worry about it. If at any point you are asked should some additional permissions be added automatically for you, just click 'yes'
Folder B set like this
and Finally, Folder C like this
In each particular case press 'Create Share' and if requested type your sudo password.
Let us now explain what kind of options we were given here
a. By clicking on Share this Folder we are enabling both the owner and the group owners to access this folder. Owner gets the full access (unless said differently in general samba rules, see above Chapter 2.2 for file and folder masks), while group members only get read-execute access by this particular rule, also general rules are applicable for group owners.
b. By checking on 'Allow others to create and delete files in this folder' we further permit everyone with access to also modify the files (however this is further decided by File and Folder Permissions)
c. By selecting Guest access, we permit guest users to connect to the folder
Let's try now to summarize several levels on which access is decided:
1. General samba rules in /etc/samba/smb.conf, especially 'Create Folder Mask and Create File Mask' (Initial values for Folder and File masks are set at 0700, which means that only owner can be granted access, therefore we had to modify this to 0775)
2. Individual samba rules (there are classic shares and user shares). In our case we used user shares rules since we had GUI, more will be said bellow, while classic shares are similar to user shares but are written at the end of /etc/samba/smb.conf file. In the past there was an application system-config-samba that represented a GUI for easier work with classic shares, however many Ubuntu Forums are warning that this has not been maintained for a longer period and is not recommended for use any more. Furthermore, usershares work just fine and it is not even necessary to use GUI for classic shares. Veteran Administrators got use to write classic share rules directly to smb.conf, so they are not affected - they can keep doing it.
3. Parent Folder Flags or masks
4. Disk Mounting Rules and Masks
5. File and Folder Permissions.
If we now compare our original tasks for three folders we will see that it is not exactly reached for folder A, since also group users from homeusers can have an access. There is an easy way to remedy this last discrepancy. Furthermore, homeusers could also access Folder C, but without write permission, so I prefer to leave it like this, since they won't be able to modify anything it is no big difference if they are loged-in (samba loged-in) as Guests or as john and mary. An additional reason will be explained later when we come to accessing to these folders from a Windows PCs.
By clicking on the Folder and selecting Folder Mount Options we have created rules for so called samba User Shares, as is already mentioned. The Samba User Shares rules are saved in the following Folder on your Ubuntu based PC:
Code: Select all
/var/lib/samba/usershares/
and these rules have same folder names but with all small letter, like on this picture.
type in terminal
Code: Select all
xed /var/lib/samba/usershares/folder*
Code: Select all
xed "/var/lib/samba/usershares/folder A"
4.4 Removing users from 'homeusers' group from access to folder A
We now just need to make a slight modification in the rules for folder A, just replace one ace with zero, like on the following two pictures, this will actually remove permission for users in the group homeusers to access Folder A and only leave access to the owner
Click Save and then close all three rules' files opened in editor. If you prefer to make same kind of modification also for folder C it is up to you.
4.4.1 Samba services restart
Finally we must not forget to restart samba services smbd and nmbd, so that everything we did becomes effective and so that we can proceed to testing. So type in Terminal
Code: Select all
sudo service smbd restart
sudo service nmbd restart
4.5 Initial testing
Network Shared Folders can be accessed in two ways
a) By IP address
b) By PC name (From the point of view of someone accessing a shared folder this becomes Samba Server name, please don't be confused here)
Additionally, Machines with Shared Folders can be visible or invisible when you click in Windows Folder Explorer on Network icon, or in Linux File Manager on Browse Network icon
Furthermore, even if sometimes your PC name appears either in Windows or Linux, by clicking on it you might gain access or get an error like 'unable to mount to selected location'.
Still more, you may be required to type full path to the Shared Folder, not just to a Samba server with several shared folders. So, still some mines ahead of us, but we are getting closer and closer to our goal.
Let us see where do we stand now, before we apply some improvements to 'visibility issues'. Just don't be afraid, I want to introduce you to all the twists and turns I have learnt about.
We will deal here with many of the above cases.
4.5.1 Accessing Shared Folder by PC name and by IP address
a) Ubuntu, Linux Mint, probably most other Linux distros
Generally you need to type in the folder address field in your File Manager (on Ubuntu based distros press Ctrl + L or icon with '.' or 'pencil' in Linux Mint if you don't see this address field but icons to Folders)
Code: Select all
smb://server-name.local/
In our case smb://Mint-20C.local/ and smb://Mint-20M.local/
if you want to access by ip adress
Code: Select all
smb://ip-address/
smb://10.1.3.62/ and smb://10.1.3.64/
Unless other Linux PCs on your home network had had some modification of smb.conf file, your share won't be available by merely giving the server-name or IP address. These two PCs from our example might only be 'visible'. Yes, another mine, but just a little bit more patience!
b) If you try now with Windows 7 or Windows 10 to click on Network icon (bottom left side of File Explorer) you will see none of our two Mint machines with shared folders.
If you type in the address field of Windows Explorer
\\Mint-20C\
or
\\Mint-20M\
Windows 7 will not be able to access anything, while Windows 10 will be the only system able at this point to access both servers by their name and show Folders for Share, but still you are the one who needs to type properly these names.
If you type in address field
\\10.1.3.62\
or
\\10.1.3.64\
In this case both Windows 7 and Windows 10 will be able to access both our servers by their IP address and present all the folders for Share, but still you are the one who needs to type properly these IP addresses.
Please, note, that Windows uses backslashes, while Linux uses forward-slashes for network folder addresses. Also Linux has smb: as a prefix.
c) If we now get back to Ubuntu and Linux Mint and if we type full path to a shared Folder, for example
smb://Mint-20C.local/Folder A
or
smb://10.1.3.62/Folder A
only now shall we be able to connect to that Folder. So folder sharing actually works but the 'visibility' is an issue.
To conclude, although we did everything to properly set Shared Folders, it is rather difficult to access them, especially by a Linux File Manager, and especially for a total beginner.
4.6.1 Improving 'visibility' between Shared Folder on Linux PCs
We can significantly improve 'visibility' and easier connectivity between Linux machines by modifying smb.conf file
Type in terminal on each Linux Machine (so not just two from our example, but on any other in your home network)
Linux Mint Cinnamon and MATE
Code: Select all
sudo xed /etc/samba/smb.conf
Code: Select all
sudo gedit /etc/samba/smb.conf
Code: Select all
sudo pluma /etc/samba/smb.conf
In any case behind line which is initially line 29 workgroup = WORKGROUP add following lines
client max protocol = SMB3
# client min protocol = NT1
server max protocol = SMB3
server min protocol = NT1
# wins support = yes
Many will immediately object why putting lines with hashtag (#) when they are just comments and don't count, but these are for users with earlier versions of Windows, they can uncomment these two lines (remove hashtags) and see if this might help them. Experiments that I conducted on Windows 7, Windows 10, MacOS Catalina, Android cell phone and Android Tablets and various Linux distros showed that maximum improvement is achieved through these three options:
client max protocol = SMB3
server max protocol = SMB3
server min protocol = NT1
So, please, paste there three or all five of those lines in your smb.conf file on all of your Linux PCs, click Save and close the editor.
client max protocol practically says that when your PC is accessing another PC it will try with Samba 3 Protocol
Other two lines say that when your PC is accessed by another PC, your PC will permit any protocol from SAMBA 1 (NT1) up to SAMBA 3, this way your PC is more flexible, but also more exposed. Modern Administrators don't like actually to have all the shared folders easily visible so that random users could play with usernames and passwords. It is up to you to decide what is optimal in your own situation. Windows PCs, actually, immediately submit credentials for the loged-in users so Administrators regulate 'visibility' of Shared Folders based on these initial credentials. Linux Mint, on other side, doesn't do that initially, but only when you click on a shared folder's icon.
Now, of course, restart samba services on all your Linux machines in order for these last modifications to be effective
Code: Select all
sudo service smbd restart
sudo service nmbd restart
We have this article to help us with more easily accessing our folder from Win10
https://devanswers.co/discover-ubuntu-machines-samba-shares-windows-10-network/
Following this article type in Terminal following lines, one by one
Code: Select all
cd /tmp
wget https://github.com/christgau/wsdd/archive/master.zip
unzip master.zip
sudo mv wsdd-master/src/wsdd.py wsdd-master/src/wsdd
sudo cp wsdd-master/src/wsdd /usr/bin
sudo cp wsdd-master/etc/systemd/wsdd.service /etc/systemd/system
sudo xed /etc/systemd/system/wsdd.service
Basically you need to replace (delete) line 12 stating
Code: Select all
DynamicUser=yes
Code: Select all
; Replace those with an unprivileged user/group that matches your environment,
; like nobody/nogroup or daemon:daemon or a dedicated user for wsdd
; User=nobody
; Group=nobody
Then proceed with Terminal
Code: Select all
sudo systemctl daemon-reload
sudo systemctl start wsdd
sudo systemctl enable wsdd
Log-out, log-in
4.7 Finally, let's see the full extent of our achievements
a) From Linux Mint Cinnamon/Mate or Ubuntu we now see both samba servers: Mint-20C and Mint-20M when we click on Network icon. By clicking on the icon we are shown all three shared folders, we can access them with credentials as per our wish.
During this testing it is recommended that you don't save passwords. Best always click on forget immediately.
b) You can also type now:
smb://10.1.3.62/ or smb://10.1.3.64/
and you will again see all three folders.
So, now everything works between Linux machines and they see what is shared on every other Linux machine.
While testing you can easily unmount any mounted Folder and then mount it with different username and password.
You can be mounted simultaneously to different folders on a same machine with different credentials (username and password)
c) From Win10
Now Shared Folders and Servers with them are visible in Windows 10 when you click on Network icon
If you like illustrations see this gallery
https://imgur.com/a/6LBvHIy
One thing, however, should be noted regarding both Win7 and Win10. You cannot connect to two different Shared Folders on a single Samba Server with two different credentials. This complicates somewhat testing of our examples. Don't save password and if you need to reset last password and username for a Samba Server you have connected to, you need to open Windows Terminal (CMD) as Administrator and type following two lines (goes both for Win7 and Win10)
Code: Select all
net stop workstation /y
net start workstation
Of course you can also access by IP address, but this was possible even before last changes.
d) From Win7
This Windows distro has been, obviously, marginalized, so I wasn't able to find anything to recommend. The only link I actually found has crashed my Win7 so I don't even want to go there - let us leave this mine "un-shared".
So the only way is to go through IP address
\\10.1.3.64\ or \\10.1.3.62\ in our case
If someone knows better please post a solution and point me there
e) From MacOS I was only able to access through IP address.
Right-click on Finder, select 'Connect to Server', then type IP address, then credentials, select Folder(s) to mount to. Illustrations are in this here gallery.
https://imgur.com/a/KYlPS4S
In general, I don't work with MacOS, so just know some basics.
From Android devices you can install free applications from Play Store like Cx File Explorer, File Manager +
These applications make it very easy to connect to a Shared Folder from your Android device.
Thanks for patience for those who were able to reach the end of this tutorial. Hope it does help someone.