Today I was working on setting up public key authentication over SSH on few servers I inherited recently. I have done this many times and never ran in to following error:
ssh_exchange_identification: Connection closed by remote host
After doing further research on the server I was trying to connect to (looking at logs) I noticed the server was denying connection based on ip. I put my servers ip in /etc/hosts.allow and tried again. This time I was connected without any problems. Note that you do not have to restart SSH for hosts.allow change to take affect.
————————————-
DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. Use at your own risk.
Thanks for the info about not having to restart. that will save me some time while I’m trying to figure out why I’m getting the same error message…
This problem is driving me crazy, I hate it!