commandlinekid

smb put linux file to windows share

Jun 12th, 2022 (edited)
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. EXAMPLE of how to:
  2.  
  3. "transfer a file from some-linux-directory TO a netbios-share ON Windows (10 pro)"
  4.  
  5. You're changing directories here both locally on the linux box (lcd) and then remotely on the windows share (cd).
  6.  
  7. You also need "-m SMB3" or it will barf because supposedly smbclient won't try SMB2 or 3.
  8.  
  9. prompt OFF means it should just push it through.
  10.  
  11. First, 192.168.1.10 is the machine to which you want to SEND the file (the windows machine). This is not the linux box you're on writing this command, that IP is irrelevant to this example.
  12.  
  13. smbclient //192.168.1.10/MAINSHARENAME --user='LINUXUSER%PASSWORD' -c "lcd /home/linuxuser/directorywithfilestosend;recurse ON;prompt OFF;cd SUBDIRECTORYONWINDOWSYOUWANTTOPUTTHEFILEINTO;mput test.txt" -m SMB3
  14.  
  15. SO what directory then would contain your new file you just put onto the windows share?
  16. ........... //192.168.1.10/MAINSHARENAME/SUBDIRECTORYONWINDOWSYOUWANTTOPUTTHEFILEINTO
Add Comment
Please, Sign In to add comment