Map a Directory to a Windows Share
Tutorial to mount a shared drive from a Windows system on a CentOS Linux server.
Installing the Samba client
Section titled “Installing the Samba client”Logged in as root, at the Linux terminal prompt type:
yum install samba-client cifs-utilsCreating the mapping
Section titled “Creating the mapping”Logged in as root, at the Linux terminal prompt enter the following commands, replacing the items below with your settings:
user = Windows user
password = Windows password
192.168.0.48 = Windows IP or host
share = Name of the share on Windows
media = Directory on the Linux system where the share will be mounted
echo username=usuário > /root/.credencialecho password=senha >> /root/.credencialecho //192.168.0.48/unidade /media cifs vers=2.0,credentials=/root/.credencial 0 0 >> /etc/fstabThe commands above will create the file /root/.credencial which will securely contain the user credentials for the Windows share and will add a configuration line to the /etc/fstab file, causing that share to be mounted automatically whenever the Linux server is restarted.
To mount the share, at the command line type:
mount /media