Hello @applecheeks37
Many thanks for your prompt feedback on my request!
In the meantime, I have tried establishing a connection to Synology NAS by entering the user name (smb://Urs@10.0.0.2).
Unfortunately, networks, folders and files can still be created with other file manager applications (Dolphin, GNOME Commander), but the owner can no longer delete them.
The deletion behavior of files on an smb share is also the same under other connected operating systems such as Windows as you mentioned.
In the meantime, I tested the connection to the Synology NAS using a bash shell script.
I found that by calling the script file manually, the access rights are correctly transferred from the Synology NAS to my Zorin client PC. This also makes it easy to delete files with other file managers as expected.
In my Zorin PC, which is a multi-user PC, I would now like to have the call to the user-defined script executed automatically after the respective user has logged into the Zorin system.
Unfortunately, my Linux knowledge is not (yet) advanced enough, so I don't know the principle behind implementing this autostart on the Zorin client.
So that you can get an idea of my manual script solution, I have listed it in the following checklist:
-
Create hidden user-specific credentials file and save it under \home\username\.credentials with the following content:
username=Urs
password=**************
domain=WORKGROUP -
Create custom script with the file name mount_NAS_username.sh with the following content:
#!/bin/bash
# Requirements
# sudo apt install cifs-utils
# Create user specific mount folders to connect local network shares
mkdir -p ~/NAS/home
mkdir -p ~/NAS/music
mkdir -p ~/NAS/photo
mkdir -p ~/NAS/video
mkdir -p ~/NAS/Common
mkdir -p ~/NAS/Business
# Connect network share with mount folder
sudo mount -t cifs //diskstation/home ~/NAS/home -o uid=$USER,gid=$USER,auto,vers=3.1.1,users,_netdev,nofail,credentials=/home/$USER/.smbcredentials
sudo mount -t cifs //diskstation/music ~/NAS/music -o uid=$USER,gid=$USER,auto,vers=3.1.1,users,_netdev,nofail,credentials=/home/$USER/.smbcredentials
sudo mount -t cifs //diskstation/photo ~/NAS/photo -o uid=$USER,gid=$USER,auto,vers=3.1.1,users,_netdev,nofail,credentials=/home/$USER/.smbcredentials
sudo mount -t cifs //diskstation/video ~/NAS/video -o uid=$USER,gid=$USER,auto,vers=3.1.1,users,_netdev,nofail,credentials=/home/$USER/.smbcredentials
sudo mount -t cifs //diskstation/Common ~/NAS/Common -o uid=$USER,gid=$USER,auto,vers=3.1.1,users,_netdev,nofail,credentials=/home/$USER/.smbcredentials
sudo mount -t cifs //diskstation/Business ~/NAS/Business -o uid=$USER,gid=$USER,auto,vers=3.1.1,users,_netdev,nofail,credentials=/home/$USER/.smbcredentials
- Make the script file mount_NAS_username.sh executable with the following bash shell command:
sudo chmod u+a
-
Save the script file mount_NAS_username.sh in the NAS directory
-
Create the script file umount_NAS.sh with the following content:
#!/bin/bash
# unmout smb shares recursivly
sudo umount -R -q ~/NAS/*
-
Save the script file umount_NAS.sh in the NAS directory
-
Make the script file umount_NAS.sh executable with the following bash shell command:
sudo chmod u+a
- Run the script mount_NAS_username.sh using the context menu and put in your password. All user specific shares are then displayed in the dash panel at the bottom right and can be used by various file managers.
It would be nice if an experienced Linux user could show me how to automatically run the manual script call after the user login without the specific user having to manually run the script and enter their password?
Perhaps there is a more elegant solution than my example? I find it very unpleasant and a security risk that the hidden file .smbcredentials contains the access data in plain text.
Perhaps someone can explain to me why I can't see any network resources (printer, Win10 PC, Windows network) apart from the FritzBox7590-1 router?
Many thanks for your support.
Kind regards,
Kobi