2

I have a Remote Port Forward SSH tunnel from the host1 the host0 at port 10022 through:

$ autossh -R 10022:localhost:22 host0

With host0 record in the ~/.ssh/config file both at host1 and host0:

# host0
Host host0
    Hostname host0ddnsip
    Port 1022
    User host0user

Established from the host0 to the host1 through:

$ ssh -p 10022 host1user@localhost

Which is done passwordless succesfully. The string host0ddnsip is the server DNS from a free service ("host0".dynu.net hosted by www.dynu.com).

The keys are stored all together in the file ~/.ssh/authorized_keys both at host1 and host0:

 ssh-rsa AFAF... ...AFAF host0user@host0
 ssh-rsa AFAF... ...AFAF host1user@host1

When doing the connection:

$ ssh -p 1022 host0user@host0ddnsip

It always requests for the password. The same happens with autossh going idle some hours at host1, turning it useless because it wants a password after that:

$ ECDSA host key for IP address 'host0ddnsip' not in list of known hosts.
$ host0user@host0ddnsip's password: 

Also at host0 the password is also requested:

$ host0user@host0ddnsip's password:

How should i make the configuration in this case?

Brethlosze
  • 247
  • 1
  • 5
  • 17
  • 1
    please, copy and paste to the question the exact outputs you see. Where is the key you are using for passwordless authentication? – Jakuje Jun 23 '17 at 06:50
  • Essentially i've just replaced the strings `host0`, `host1`, `host0user`, `host1user`, `host0ddnsip`, and the key strings, and all other texts are equal. The only output is the `ECDSA host key....` already pasted in the end of the question, requesting the password. – Brethlosze Jun 23 '17 at 15:50
  • 1
    Once more: Where are the authentication keys stored in your client? To resolve the question, running the `ssh` command with `-vvv` switches to see a debug log would be very helpful. – Jakuje Jun 23 '17 at 18:28
  • Ok, i will do and update accordingly – Brethlosze Jun 23 '17 at 18:29
  • 1
    Are you using the right username? You use both `host` and `host0user` in your question. Also you havent provided much needed information, like the sshd_config on the server, etc. The sshd logs would be helpful, so would upping the verbosity (which will print useful information). Likely `ssh -vvv` and the sshd logs will tell you a suitable key was not found. – Charles D Pantoga Jul 27 '17 at 06:23
  • Now i had another error, i think not related with this problem :). – Brethlosze Jul 27 '17 at 06:32
  • I finally fixed it. The mechanism of the ssh server, involving the key storage was not done through `authorized_keys` file, but through a manual upload. I am using Bitvise SSH server... – Brethlosze Jul 28 '17 at 07:36

0 Answers0