0

Is it possible to force SFTP to use the configured public key only and not to proceed to other authentication method like password auth on failure to authenticate using public key? the PasswordAuthentication no in sshd_config is not possible as the user is also being used during putty & winscp connection. Thank you in advance!

1
  • Why not have them to use key-based auth in Putty and WinSCP also? Jun 25, 2018 at 9:38

3 Answers 3

1

Thank you all for your replies. Instead of adjusting the sshd_config file. I just added the -oBatchMode=yes in the SFTP command in the shell script and I think it worked for me.

0

Yes, you can access with the public-key. But before accessing SFTP using public key we want to set "PasswordAuthentication=no" in the ssh configuration file "/etc/sshd/sshd_config" so that you cannot access via remote using the user password.

0

Change the relevant lines of /etc/ssh/sshd_config and/or add these at the end:

ChallengeResponseAuthentication no
PasswordAuthentication no

These default to "no" anyway, but make sure these are not set to "yes".

GSSAPIAuthentication no
HostbasedAuthentication no
RhostsRSAAuthentication no

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .