1

I have created one vpc with three different subnets and I am facing issue while doing ssh from instances. getting check public key error but succeed before.

tarun@eu-vm:~$ ssh 192.168.0.3
Linux web-server-gqnt 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Jun 29 19:06:40 2021 from 35.235.240.48
tarun@web-server-gqnt:~$ 
tarun@web-server-gqnt:~$ 
tarun@web-server-gqnt:~$ exit
logout
Connection to 192.168.0.3 closed.
tarun@eu-vm:~$ ssh 192.168.0.2
tarun@192.168.0.2: Permission denied (publickey).
tarun@eu-vm:~$ 
tarun@eu-vm:~$ 
tarun@eu-vm:~$ ssh 192.168.0.3
tarun@192.168.0.3: Permission denied (publickey).
tarun@eu-vm:~$ 
tarun@eu-vm:~$ 
Nikhil
  • 118
  • 4

2 Answers2

1

For ssh communication, it checks whether the key is secure or not. So, you should not give full permissions to it to everyone.

change the permissions as:

chmod 600 <keyfile>
uday
  • 352
  • 10
  • 30
0

You can check if the connection to ssh port is all right by: telnet 192.168.0.2 22 and if it ask you to abort by pressing ^] just press Ctrl+] and then enter quit. If it works this way you can establish connection to the ssh port of 192.168.0.2 but something goes wrong afterwards.

George Y
  • 528
  • 6
  • 16