How to mount Windows shares or Samba on Linux Centos and Ubuntu

If we need to work together with team or access windows storage, we need to mount remote windows share or Samba on CentOS 7.
Mounting Windows or other samba) shares is done through the cifs virtual file system client (cifs vfs) implemented in kernel and a mount helper mount.cifs.
If we are managing a multi user system, consider setting the dir_mode and file_mode options to your mount point.
The default behaviour for mount.cifs is leaving the mounted share unsecured (http://bugs.centos.org/view.php?id=4537).
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
Example output:
[root@pion ~]# yum install samba-client samba-common cifs-utils Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.vodien.com * epel: pkg.adfinis-sygroup.ch * extras: mirror.vodien.com * remi-safe: mirrors.thzhost.com * updates: mirror.vodien.com Resolving Dependencies --> Running transaction check ---> Package cifs-utils.x86_64 0:6.2-10.el7 will be installed --> Processing Dependency: libwbclient.so.0(WBCLIENT_0.9)(64bit) for package: cifs-utils-6.2-10.el7.x86_64 ................................. --> Running transaction check ---> Package libtdb.x86_64 0:1.3.16-1.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ................................................................. Installed: cifs-utils.x86_64 0:6.2-10.el7 samba-client.x86_64 0:4.9.1-6.el7 samba-common.noarch 0:4.9.1-6.el7 Dependency Installed: libldb.x86_64 0:1.4.2-1.el7 libsmbclient.x86_64 0:4.9.1-6.el7 libtalloc.x86_64 0:2.1.14-1.el7 libtdb.x86_64 0:1.3.16-1.el7 libtevent.x86_64 0:0.9.37-1.el7 libwbclient.x86_64 0:4.9.1-6.el7 samba-client-libs.x86_64 0:4.9.1-6.el7 samba-common-libs.x86_64 0:4.9.1-6.el7 Complete!
Create a local mount point directory, for example: