1

When you physically log into a computer via terminal, getty takes care of the authentication part with help of /bin/login.

My question, how does SSH password authentication works? Does SSH use /bin/login to perform the authentication?

After extensive Google searches, I couldn't find anything.

1 Answer 1

3

SSH authenticates by using the SSH protocol.

Using the -vv option when connecting to another server using SSH will show you more detailed information on the key exchange, protocol negotiation, etc.

Event Sequence of an SSH Connection

The following series of events help protect the integrity of SSH communication between two hosts.

  1. A cryptographic handshake is made so that the client can verify that it is communicating with the correct server.
  2. The transport layer of the connection between the client and remote host is encrypted using a symmetric cipher.
  3. The client authenticates itself to the server.
  4. The client interacts with the remote host over the encrypted
    connection.

SSH servers and clients can be configured to allow different types of authentication, which gives each side the optimal amount of control. The server can decide which encryption methods it supports based on its security model, and the client can choose the order of authentication methods to attempt from the available options.

You can read more about the specifics on Red Hat's website:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-OpenSSH#s2-ssh-versions

4
  • I know about these workflows..I just wanted to know how sshd service do password authentication? does it use /bin/login ?
    – Nijil
    Oct 22, 2019 at 18:38
  • 1
    @Nijil In many/most instances, ssh uses the PAM protocol, which stands for Pluggable Authentication Modules. PAM can be configured to use any of a number of different authentication methods. en.wikipedia.org/wiki/Pluggable_authentication_module
    – Jim L.
    Oct 22, 2019 at 18:43
  • @Nijil for the sake of clarity, no SSH dies not use /bin/login, although there are some scenarios where /bin/login and SSH will call the same authentication libraries.
    – davidgo
    Oct 23, 2019 at 6:48
  • Thanks JimL and davidgo :) If you can put your comments as answers, I can mark it as one.
    – Nijil
    Oct 23, 2019 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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