Howto Linux / UNIX setup SSH with DSA public key authentication (password less login)

http‮w//:s‬ww.lautturi.com
Howto Linux / UNIX setup SSH with DSA public key authentication (password less login)

To set up SSH with DSA (Digital Signature Algorithm) public key authentication on a Linux or Unix system, you will need to follow these steps:

  1. Generate a DSA key pair on the client system. This can be done using the "ssh-keygen" command. For example:

ssh-keygen -t dsa

This will generate a private key and a public key, which will be stored in the "~/.ssh" directory.

  1. Copy the public key to the server system. This can be done using the "ssh-copy-id" command. For example:

ssh-copy-id user@server

Replace "user" and "server" with the appropriate values for your setup.

  1. Edit the "~/.ssh/authorized_keys" file on the server system and ensure that the public key you copied is listed in the file.

  2. Edit the "~/.ssh/config" file on the client system and add the following lines to enable public key authentication:

Host server
IdentityFile ~/.ssh/id_dsa
User user

Replace "server" and "user" with the appropriate values for your setup.

  1. Test the connection to the server using the "ssh" command. If the configuration is correct, you should be able to log in to the server without being prompted for a password.

It's worth noting that DSA public key authentication is considered less secure than other methods such as RSA or Ed25519. You should consider using a different algorithm if possible.

Created Time:2017-10-29 22:08:46  Author:lautturi