Q: Let subprocess.check_output timeout when there is a user prompt I have a Python script that use scp to transfer some files to other remote hosts.
    try:
        out = subprocess.check_output(f"scp filename.txt user1@host1:/home/user1/", stderr=subprocess.STDOUT, timeout=15)
        print(out)
    except subprocess.TimeoutExpired as e:
        print(e.output)
        // Handle hostkey verification error

Now sometimes, it's possible that the remote server isn't authenticated and part of known hosts files, in which case the script just forever stays in waiting state for user input with Are you sure you want to continue connecting (yes/no/[fingerprint])?
What I want is to be able to catch this scenario, so I can handle host key verification. I tried adding timeout and catch the exception but instead of timing out it still stays in user prompt state.
