There are many tools to copy files between Windows and Linux computers, I have found this method the simplest.
It does not require any software installation on the Windows machine, and only one package installation on the Linux machine.
Share a folder on the Windows machine
Share a folder on the Windows machine and allow access to it for a user. If the Windows computer is in the Windows domain, the domain user does not have to be a member of any security group on the Windows machine.
If you copy files from Windows to Linux, make the folder read-only for the user. If you copy files to the Windows machine, allow write access to the folder for the user.
Set up the Linux machine
- Install the cifs-utils on the Linux machine
- On Red Hat, CentOS, and Amazon Linux
sudo yum install cifs-utils
- On Ubuntu
sudo apt-get install cifs-utils
- On Red Hat, CentOS, and Amazon Linux
Mount the shared Windows folder on the Linux machine
- On the Linux machine create a directory to mount the Windows folder to
mkdir /tmp/windows
- Mount the Windows share
sudo mount.cifs '\\WINDOWS_SERVER_IP\attachments' /tmp/windows -o domain=MY_DOMAIN,username=MY_USERNAME,password=MY_PASSWORD,vers=1.0
First, you will be asked for the root password on the Linux machine.
If you do not specify your password in the line above, you will be also asked to enter your password on the Windows machine.
Access the Windows share
- On the Linux machine navigate to the mount directory
cd /tmp/windows
- List the files of the Windows share
ls -al
Troubleshooting
If you get the error message when you issue the mount command
mount error(16): Device or resource busy
try to unmount (umount !) the share first and try the mount again
umount /tmp/windows