0

We have a linux system and windows and need to transfer file to a shared location \local\insurance\input password less

We have file.txt in linux and we need to copy to windows shared paths.

Is there any syntax to do that , i tried below command and didnt worked

scp file.txt admin@insurancepp01:\\local\insurance\input 

Please any suggestion or reference links for UNC paths

I tried curl --upload-file dummy.txt --user "abc\admin" smb:\\local\insurance\input.

I cannot install smbclient as we have limitation and need to discuss with admin team.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Arya
  • 306
  • 1
  • 4
  • 13
  • 1
    `man smbclient` - why are you using SCP (SSH) to access a whole different protocol (CIFS) is beyond me. Do you also use a web browser to open Windows File Shares? https://unix.stackexchange.com/a/206416 – Artem S. Tashkinov Jul 06 '22 at 11:56
  • 1
    Does this answer your question? [Sending files over Samba with command line](https://unix.stackexchange.com/questions/206415/sending-files-over-samba-with-command-line) – Artem S. Tashkinov Jul 06 '22 at 11:57
  • @ArtemS.Tashkinov .. Thanks a lot for the reply , but it cant help me though as the example is between windows to windows, as in my case linux to windows shared drive – Arya Jul 06 '22 at 11:59
  • 1
    `smbclient` is a **Linux (Unix) command**. – Artem S. Tashkinov Jul 06 '22 at 12:00
  • 1
    Well, discuss it with your admin, as `smbclient` is **the tool you need**. There are no other options AFAIK. curl will not work for you. – Artem S. Tashkinov Jul 06 '22 at 13:27
  • Forget `scp`, that is useful for Unix2Unix file transfer as you need an ssh server on the other side (and not a WIndows share). Check other answers above, Samba is your friend. – redseven Jul 06 '22 at 15:40
  • 1
    your curl command is almost fine, just replace: `smb:\\local\insurance\input` --> `smb://local/insurance/input` – redseven Jul 06 '22 at 15:41
  • @redseven . I just updated the command and getting below error :::: " curl: (1) Protocol smb not supported or disabled in libcurl " – Arya Jul 07 '22 at 18:17
  • @redseven Any suggestion pls with the above error – Arya Jul 07 '22 at 18:20
  • What is your curl version? smb is supported since v7.4 (released in 2015). What distribution do you use? – redseven Jul 08 '22 at 11:28

0 Answers0