6. Open the /etc/ssh/sshd_config file and set following parameter
cd /etc/ssh
vi sshd-config
--set the following parameter to YES option and uncomment with NO option
password authentication parameter to yes
ChallengeResponseAuthentication to yes

7. Restart the sshd service using the below command service sshd restart
[root@ip-172-31-16-82 ssh]# service sshd restart
Redirecting to /bin/systemctl restart sshd.service

9. Setup a VNC password with command vncpasswd
[ec2-user@ip-172-31-16-82 ~]$ vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used
[ec2-user@ip-172-31-16-82 ~]$