简体   繁体   中英

Copy File from Windows Host to Linux [Python]

What are the different modules/ways to copy file from a windows computer to a linux server available in python

I tried using ftplib api to connect to the windows server but im unable to do with the error - socket.error: [Errno 111] Connection refused

What are the other modules that i can connect to a windows computer to copy or list the files under a directory

If you have access to linux server, and the file generated on windows automatically, you can do the folowing:

  1. Generate ssh-key on your windows maching

  2. Add it to authorized_hosts of the linux machine

  3. Install simple console scp tool on windows

  4. Write simple cmd-script to copy file with help of scp, something like:

    scp c:\\path\\to\\file.txt user@linuxhost.local:/home/user/file.txt

  5. Run this script automatically every time, then the file is generated on windows host.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM