local SSH works when using "localhost", but not using IP address

Solution 1:

If the ssh connection works pointing to localhost, means that it's going to 127.0.0.1. If it fails with pointing to 192.168.2.12 should be because your ssh is listening on 127.0.0.1 (localhost).

Check your ListenAddress on sshd configuration file.