Secure Copy File from remote server via scp and os module in Python
- by user1063572
I'm pretty new to Python and programming. I'm trying to copy a file between two computers via a python script. However the code
os.system("ssh " + hostname + " scp " + filepath + " " + user + "@" + localhost + ":" cwd)
won't work. I think it needs a password, as descriped in How do I copy a file to a remote server in python using scp or ssh?. I…