I have created one vpc with three different subnets and I am facing issue while doing ssh from instances. getting check public key error
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
[email protected]: Permission denied (publickey).
tarun@eu-vm:~$
tarun@eu-vm:~$
tarun@eu-vm:~$ ssh 192.168.0.3
[email protected]: Permission denied (publickey).
tarun@eu-vm:~$
tarun@eu-vm:~$
Solution 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>