Table of Contents
Copy files from a windows share on Centos / Redhat distributions
Mount the windows share
First we need to mount locally the windows share folder. For this we'll use the cifs-utils package.
You should use the root user for the following commands, otherwise append sudo in front of them.
yum install cifs-utils mkdir /mnt/share
If the windows share requires authentication, append the user and password in a local file:
vi /etc/smbcredentials username=YOUR_USERNAME password=YOUR_PASSWORD
Secure the file:
chmod 600 /etc/smbcredentials
Mount the share:
mount -t cifs -o credentials=/etc/smbcredentials //machine/folder/ /mnt/share
If you don't want to use a credential file (less secure) you can run directly:
mount -t cifs //machine/folder/ /mnt/share -o username=user,password=default
Copy files from the share
cp /mnt/share/your_file /dest/directory