On 2025-10-26 at 14:15, Hans wrote: > Hi folks, > > I don't know, whom to ask, so I olease let me ask here. > > I am looking for a way, to copy some files from linux to windows. I > searched the web, but could not find any usefull answers. > > These are the demandable conditions: > > 1. Must be a commandline command (so usable in a shell, no GUI-tools > like Winscp, Putty or similar) > > 2. No installation of any additional tools on the windows system > (like putty or similar) > > 3. No extra protocol activation on the windows system (like ftp or > ssh) > > 4. username and password of the windows user are known > > 5. The target path on windows should be findable or setable, thus an > executable can be copied and executed > > Does one know, if this can be already done, especially with Win_11? I have not tested explicitly (I might be in a position to do so sometime later this week), but I suspect that it may be possible without any custom setup on the Windows side, via a CIFS mount-point and the Windows implicit drive-letter share. Under Windows, by default (and I don't actually know if there even *is* a way to turn this off, although I suspect so), it is possible to access the C: drive of a remote computer named 'winbox' via the UNC path \\winbox\c$\ if and only if the connection attempt is being made with a set of user credentials which have the appropriate access on that remote computer. Any username which is capable of logging in via the Windows GUI on that computer will probably work; a local user account on that computer which has local-administrator access on that computer will definitely work. Drives mapped to other drive letters can be accessed with the same approach, by just using the other drive letter instead of 'c'. I know multiple ways to do that from under Windows, but not for certain how to do something analogous from under Linux. I am fully confident that it can be done using CIFS, but what the remote-path string would need to be I am not certain of. I *think* the command it would involve would look like # mount -t cifs -o user=WINDOWS_USERNAME \ '//WINDOWS_COMPUTER_NAME/c$/path/to/destination/directory' \ /mnt/cifs (where you've created '/mnt/cifs' beforehand, and are running the command as root), but I am not certain. Note that even if it works, this syntax will result in the directory and its contents appearing to be owned by root; if you want it to be owned and/or otherwise writable by other users, you'll need to append ',uid=[some user ID]' or ',gid=[some group ID]' after the 'user=WINDOWS_USERNAME' option. If that exact syntax doesn't work, you may need to experiment and/or read documentation to figure out what will, but there should be a way to get this working. Once the directory is mounted that way, you should be able to interact with it using standard Linux tools, including 'ls' and 'cp' and graphical file managers and so forth. > Moszt solutions, I found, are using scp or putty and a ssh-demon on > the windows system. But this is not, what I want (see above). > > My idea was, to copy the files to a folder of the user by a single > command in the shell, and then execute this also from a shell i.E. > using winexe on linux. Is this technically possible at all or do I > completely thinking wrong? I'm not at all familiar with winexe, so I can't advise you on that part unless I get a chance to experiment with it first. -- The Wanderer The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw
Attachment:
signature.asc
Description: OpenPGP digital signature