SSH Using Wrong ID
I am trying to establish password-less ssh to myself on a CentOS6 system.
I go through the following steps:
ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
cat ~/.ssh/id_dsa >> ~/.ssh/authorized_keys
The appropriate public and private key files, as well as authorized keys
are all created. The contents of ~/.ssh/id_dsa.pub is shown below:
ssh-dss
AAAAB3NzaC1kc3MAAACBAMtCKpsSeE8DxjvMqCl2S62YGmR/UMXpLH+tOuCiHzITUnB44kTBfh16WGRjAKdoFcrx/xIZBXyP5YTo1rIGzLbIK+LILOyaIe17mVYWgBs5k5WENLQKwQ3W0kaNvkN+uTcGArDl9r6o8oi8Lnox0ldCp/zGsNZuJfUnCOxX0PthAAAAFQD9wyrHwmyjMKWUhva+pwzhkYjbgQAAAIAqxFHO/Cb834Wa+PcNB80PvcPlwKHMrPnPZcEl+INsNmENU+khLe812GMD8GEsLbLxMgVKlFVAGXT0WUhCYpx7VTeawZ6/dOYlOf44Bjn2z6KAPkQaZyfTzF9gcunDdBY3uHJnOnj9c2bNfMPNc46D5cfPbAov/cNNnue2VWsmtwAAAIEAvJxL25YgbwJdwusIwcVMGjoFj8pRjYKFJwOLvfW1N+UI9u1ZCEkNmuRuOCSRgqDhL0Zr7qv11S8GT4sDdMat6xR7Qhw/Q3NwG4XIOJ5hGoHqlwIleE095JPQnmy8/ffn4qOYPql19RGwTM3lynGVIXBxcIEKzdmeoZKWG3ejS+I=
admin-cloud@computer.network.net
However, when I then run a "ssh computer.network.net" or "ssh localhost"
command, I am prompted for a password (first problem). After entering the
password and establishing the ssh session, I exit and inspect the
~/.ssh/known_hosts file, where the following key has been cached:
localhost ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAQEApHXsA7mMOtqKO1XotKTk5vM5F1LRoqxLLZw2TVLUA36BrkJAMM1EqfnH3mIoNz6sJzOdmQV2ubYGkzvCUb1TX8wUId1KQki8I1l2S52vFEwHkJlFe+KFQcU4SBtxDRDEvHkiLid0D37V+O3W6ElxhhRjkL+nebFPSFEdDlwBUTzAmR3KPD9zFjLP3JJZrwYH1E1sEl52pHbrcr7ROhfRjtz+3glVog9tJC3Xbfwu74JeywYrKQXbtDV84CJ0FoD6WAtJ+V0Dh8hnyBDkdbBc/zVIEDcXfcVNA4yc2noAHdQQ6p11Q8zW94/aJVhi/t0D9vSVMZP8UbHmnM2RfElIww==
which is an RSA key, not the DSA key I generated (second problem). After
doing some digging I found this RSA key in /etc/ssh/ssh_host_rsa_key.pub.
Why is SSH using the keys in the /etc/ssh folder and not the keys I
generated in the ~/.ssh folder? How can I tell SSH to use the public
private key pair in the ~/.ssh folder. A look at man ssh seems to indicate
this is the default behaviour but is clearly not happening.
Thanks in advance.
No comments:
Post a Comment