Authentication in Ssh
The client tries to authenticate itself using:
If the client successfully authenticates itself, a dialog for preparing the session is entered.
At this time the client may request things like:
The two sides enters then in session mode.
ssh supports public key authentication scheme that permits you to be authenticated op basis of:
The private key known also as identity files can be specified:
Example with OpenSSH ssh
ssh -G <hostname> | grep pubkey
# ssh -G [email protected] | grep pubkey
pubkeyauthentication yes
pubkeyacceptedkeytypes [email protected] ............
ssh -G <hostname> | grep identityfile
ssh -G [email protected] | grep identityfile
identityfile ~/.ssh/id_rsa
identityfile ~/.ssh/id_dsa
identityfile ~/.ssh/id_ecdsa
identityfile ~/.ssh/id_ecdsa_sk
identityfile ~/.ssh/id_ed25519
identityfile ~/.ssh/id_ed25519_sk
identityfile ~/.ssh/id_xmss
You cannot pass the password via stdin. This is by designed.
ssh uses direct TTY access to make sure that the password is indeed issued by an interactive keyboard user.