Why i have an ip for ssh and ifconfig shows another one in eth0?

Solution 1:

Potentially you had a static IP address defined but also had DHCP running.

Instead of using ifconfig, see if there are multiple ip addresses configured on the interface via

ip addr show eth0

See if there is a dhcp service running

ps -ef | grep dhcp

You can disable the dhcp service via

sudo systemctl disable dhcpcd

Then i would say restart the device and see if the secondary IP address has disappeared. This could have happened because your DNS (/etc/resolv.conf) is setup correctly and points to your DHCP server to grab an IP