SSH private key, used for authentication or encryption?

July 28, 2015 3.1k views
Security DigitalOcean

I’m confused around the concept of SSH authentication. Is ssh key excange necessary for actually authenticating or just encrypting the login attempt and subsequent data exchange?? I mean isn’t username/password used for authenticating?

In other words, if someone finds my user name and password by brute forcing would he be able to login without having hold of my client private key?

And why use a private* client* key instead of a public client key with a server private key?

2 Answers

the private key is an alternative to a password, so a username + private key would be used and much more difficult to brute force (much much more complex)

  • I’ve gone through the ssh key generation and installation but when connecting to the server it always asks me for a username and password? What do I do wrong?

  • user000, by default Passwords are still allowed to be used
    Either your public key isn’t in the correct place on your server, or your SSH Client isn’t attempting to use the private key (could be permissions issue on either side too)

  • and if I disable the username/password scheme and use ssh keys instead, what happens with sftp?
    is there a simillar process for sftp as well?

  • SFTP is over SSH so it support PubKey auth too, you’d just need a supporting SFTP Client (like FileZilla)

  • thank you very much for your replies

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!