0

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?

laurent
  • 88,262
  • 77
  • 290
  • 428
  • I've done something similar to what you're describing by using an `expect` script. I don't have that handy, but expect isn't difficult to learn if you don't already know it. – mah Oct 14 '13 at 04:54
  • `-o PreferredAuthentications=publickey` – salva Oct 14 '13 at 09:10

1 Answers1

0

The option I was looking for is -B:

-B      Selects batch mode (prevents asking for passwords or passphrases).
laurent
  • 88,262
  • 77
  • 290
  • 428