I'm using .NET core for an application running on a Linux machine (a docker container, to be exact)
How can I copy a binary file from there to a windows network share (including username & password)?
All solutions I've found were windows specific, but nothing related to Linux.
Use the cp command to copy files in the Linux terminal. To copy a file on a computer with a graphical interface, you usually either drag and drop a file from one window to another window, sometimes using a modifier key.
To copy a file from Linux to windows, you have to create a new folder, i.e., “Share,” in the home directory, as shown below. Right-click on it and tap on “Properties.” Expand the ” Local Network Share ” section within the Properties dialogue that appeared on your screen, expand the “Local Network Share” section.
To transfer data between Windows and Linux, simply open FileZilla on a Windows machine and follow the below steps: Navigate and open File > Site Manager. Click a New Site. Set the Protocol to SFTP (SSH File Transfer Protocol).
Once connected, you can simply drag-and-drop all the necessary files between Linux and Windows machines. Making a folder accessible over a network is the most straightforward approach to share files between Windows and Linux machines. However, this approach is fundamentally different from others.
Set the Protocol to SFTP (SSH File Transfer Protocol). Set the Hostname to the IP address of the Linux machine. Set the Logon Type as Normal. Add the username and password of the Linux machine . Click on connect. Once connected, you can simply drag-and-drop all the necessary files between Linux and Windows machines.
How about by using CIFS from Samba to mount the share. Once you've installed cifs-utils, you could try something like:
mkdir ~/localMountPoint
mount -t cifs //server/share ~/localMountPoint -o user=myname,pass=mypassword
There's a more in depth tutorial here: https://www.howtogeek.com/176471/how-to-share-files-between-windows-and-linux/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With