سؤال

I'm using scp in a script, which normally should always use private key authentication. If for some reason the private key is missing, I want the script to fail rather than display a password prompt.

Is it possible to disable this prompt, or to somehow specify that private key authentication should always be used?

هل كانت مفيدة؟

المحلول

The option I was looking for is -B:

-B      Selects batch mode (prevents asking for passwords or passphrases).
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top