Ssh Permission Denied from cmd

I am currently on the Chapter Lab Setup, specifically in the video: Multiple VMs and Networking.
I am trying to login in my virtual machine through cmd, using the ssh root@[ip] command.
However, I always get Permission denied.
This is despite following all the instructions given in the video in the exact manner. Although instructions in the video were in MacOS, I am using Windows.
Screenshot 2023-04-10 173327
I have created Host Only Network Adapter in Network Manager called VirtualBox Host-Only Ethernet Adapter #2
And it’s details also show up in ipconfig command on windows terminal.
Also, both the VMs are configured with this Host only Network Adapter #2 in Adapter 2.

What I have tried:
Changing the root password
Web tutorials of fixes in sshd_config file by changing permissions such as

  • PermitRootLogin
  • PubkeyAuthentication
  • GSAPI Authentication and CleanUpCredentials
  • UsePAM

But the problem still persists.
[Edit] I am using CentOS version 9

Hi @gadekar.ishan,
Did you restart the SSHD service after making these changes?

Hi and thanks for your response, well yes, using the systemctl restart sshd command

Hi, I provisioned a new VM, installed the CentOS 9 vdi again,
and then in the /etc/ssh/sshd_config file set PermitRootLogin from ‘prohibited-password’ to ‘yes’
Then I restarted the SSHD service using systemctl restart sshd.
My error is solved now, I think my VM was corrupted due to some reason, as this fix did not work before.
Thank you again, for attending my query :smiley:

1 Like