I have a problem for several days. On my Raspberry Pi I go to the terminal for executing the following command:
scp user@subdomain.server.com:/home/path/to/file/test.py /home/pi/update/test.py
It works fine and copies the file from the server without password (because of ssh-keys) to my local machine.
BUT: I have to do exactly the same within a python script:
import os
cmd = 'scp user@subdomain.server.com:/home/path/to/file/test.py /home/pi/update/test.py'
os.system(cmd)
This doesn't work giving an error
ssh: Could not resolve hostname subdomain.server.com: Temporary failure in name resolution
Why do I get this message and especially how can I solve it? Does anyone give an advice, please? I don't understand it ...