Unable to SSH into VM using root@loopback addr on MAC

Hello there,

I have been trying to ssh to my cent OS VM from my mac machine but i constantly get “Permission denied, please try again.”, when i check “service sshd status -l”, it tells me an invalid user tried to login, please advice

The system is asking for the password you set up in your CentOS, you should type it after you run the command even though it is invisible for security purposes. Are you putting the CentOS password when it is requested there?

The problem is not the password, because i used the same password to login to cent OS on guest machine, it is saying permission denied, it has to do with permissions, i checked the ssh logs on the cent OS machine, and i saw that it reference the host system as an invalid user, i have tried to edit the etc/ssh/ssh_config file; changingthe value of PermitrootLogin to Yes and i also changed the value of Password Authentication to yes but issue still persists

the simple answer is that you won’t be able to do that. since that’s your mac’s loopback. Now, unless you have tunnelled your VM’s ssh port to your mac’s loopback port 2222 (why would you need to do such a thing??) it’s not the right way to go.
At a guess, you have NATted your vms so get your vm’s address from whatever virtualization you use or alternatively execute ‘ifconfig’ command and get the IP from there.
Linux and *NiX systems are case sensitive, it is considered good practice to use all lowercase basically everywhere. it will make your like a hell of a lot easier when you gain more practive.
Other note: your user may be part of the root group on the vm but is definitely NOT THE root user.
It’s also a bad practice to make users part of the root group. That’s why there is a utility called sudo, which i recommend you to look into.

So, check if your user is actually with a capital S, and try to log in with ‘ssh saviour@whaterver_your_vm_nat_ip_is -p 2222’

Hope this clears it up a bit