samba
Windows (10) doesn’t allow the same resource twice
So, the NAS* I use for years is separated into different partitions. Some for general access and things and one for music, which has a special user, which owns just read-only privileges.
Linux: no problem: mount as many shares with Gigolo and you are done.
Windows: use that 90s-style network-mount of the ‘explorer’ and add share by resource and credentials.
“\\ds213\musik” .. Works, but is awkward and not comfortable.
then you want to mount the second share with different credentials and you get “Can’t mount the same share** with different credentials”.
Workaround:
mount once by resource-name and once by ip: “\\192.168.178.178\musik”
Another approach via the hosts-file.
* DS213 from Synology: 2 bay; now running 24/7 for 5 (?) years; upgraded inbetween from 2 TByte drives to 4 TB with complete replication
** is actually “different shares at the same host”, but who am I with my limited knowledge?
share a folder via SMB on CLI
The missing counter-part for this post.
- create new smb-user pi: “
$ sudo smbpasswd -a pi
“ - create directory: “
$ mkdir freigabeATminipc
“ - set rights: “
$ sudo chmod 770 freigabeATminipc/
“ - edit config: “
$ sudo nano /etc/samba/smb.conf
”
add at end of the file the following and save-quit (CTRL+X; y)
1 2 3 4 5 6 7 |
[freigabeATminipc] comment = for sharing path = /home/pi/Desktop/freigabeATminipc valid users = pi browseable = yes read only = no guest ok = yes |
- restart: “
$ sudo service smbd restart
“ - check if everything fits: “
$ testparm
“
mount a smb-share (not via fstab!)
Don’t know how often I did this on several systems and still always(!) have to pick the parameters.
1 2 3 |
$ sudo apt-fast install samba samba-common smbclient cifs-utils $ mkdir freigabeATminipc $ sudo mount -t cifs -o user=guest //MINIPC/freigabe freigabeATminipc/ |
Check for available shares in the network via “smbtree”.