in reply to Re^4: Preferred authentication in Net::SFTP::Foreign
in thread Preferred authentication in Net::SFTP::Foreign

I can't hardcode the PreferredAuthentication since it is host specific and we do have a properly configured .ssh/config file with the appropriate Host specific overrides.

PreferredAuthentication is usually quite unimportant, as long as you include all the authentication schemes that could be required by the server it should work. There is no need to match exactly the server configuration there.

What do you get from the following command?

grep -i preferredauthentications ~/.ssh/config | sort -u

For Net::SFTP::Foreign, the important thing is knowing which servers require password authentication and which one don't.

Replies are listed 'Best First'.
Re^6: Preferred authentication in Net::SFTP::Foreign
by mithunbh (Novice) on Feb 11, 2016 at 23:42 UTC
    $ grep -i preferredauthentications ~/.ssh/config | sort -u PreferredAuthentications password PreferredAuthentications publickey,keyboard-interactive,password
    More importantly this is the current distribution with a global setting and multiple Host entries with overrides
    $ grep PreferredAuthentications ~/.ssh/config PreferredAuthentications publickey,keyboard-interactive,password PreferredAuthentications password PreferredAuthentications password
    Agreed it is important to know who needs password and who doesn't and for a really short test period it doesn't seem to have impacted us by removing the PreferredAuthentications override - ssh does seem to honor what is in the config file. Maybe something has changed over time and this functionality might have become redundant - is this something which can be retested ?