Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have ssh key based authentication setup for some depolyment script. But there is a chance that the authentication files are not setup properly at some point. I don't want my shell scripts to ask for passwords, i want them to fail immediately.

Using

ssh -o KbdInteractiveAuthentication=no -o PasswordAuthentication=no -o PubkeyAuthentication=yes test@host

or some thing along those lines does not work. I dont want to change configuration files since the script can be executed from any where.

share|improve this question
    
Can't you simply allow only PubkeyAuth in the sshd config on the host? –  ott-- Oct 27 '11 at 18:19
    
nopes, every thing has to be in the command it's self. –  Shahzada Hatim Oct 30 '11 at 21:31
1  
openssh has batchmode for this: serverfault.com/questions/61915/… –  ott-- Oct 30 '11 at 21:41
    
thanks ott, you can post this as an answer and i will accept it :) –  Shahzada Hatim Nov 1 '11 at 8:38
    
openssh has batchmode for this: serverfault.com/questions/61915/… –  ott-- Nov 1 '11 at 15:19
show 3 more comments

1 Answer 1

I just had this problem and found the answer here:

http://www.gossamer-threads.com/lists/openssh/dev/47179

Basically, openssh used keyboard-interactive to implement challenge-repsonse. So if either of these options are set to "yes", then keyboard-interactive gets set to "yes" in the code. You have to set both to "no" in order to get the behavior you want.

I had to do:

ssh -o PasswordAuthentication=no -o KbdInteractiveAuthentication=no -o ChallengeResponseAuthentication=no

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.