How to mount Windows shares or Samba on Linux Centos and Ubuntu
The default behaviour for mount.cifs is leaving the mounted share unsecured
For Centos:
# yum install samba-client samba-common cifs-utils
For Ubuntu:
# sudo apt-get install cifs-utils samba-common system-config-samba samba winbind
Create a local mount point directory, for example:
# mkdir /mnt/windows
Example Windows share detail is:
Remote Windows machine ip address is 192.168.1.9
share name : storage-photo
username: pion
password: my_password
# mount.cifs //192.168.1.9/storage-photo /mnt/windows-storage -o rw,user=pion,pass=my_password,dom=domain.local,vers=3.0
If you want to auto mount on boot, edit /etc/fstab and add the following mount command:
//192.168.1.9/storage-photo /mnt/windows-storage cifs rw,user=pion,pass=my_password,dom=domain.local,vers=3.0
show map
df -h
We have free backup storage box backup on Hetzner.
This is great feature from Hetzner if you rent Dedicated server with middle or high specs.
This is how we mount storage box using cifs and keep the cradentials on /root directory.