question

arunkumar-8707 avatar image
0 Votes"
arunkumar-8707 asked vipullag-MSFT commented

password to SSH option reset for linux

Hi Team

i had changed password option to SSH option for login to the VM in the azure portal. after that both the SSH and password options are working to login VM.

i can't able to stop VM, please help me with the steps for removing the password login option to VM.

Regards
Arun C V

azure-virtual-machines
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@arunkumar-8707

Any update on the issue?

Just checking in to see if you got a chance to see previous response.

Please 'Accept as answer' if the provided information is helpful, so that it can help others in the community looking for help on similar topics.

0 Votes 0 ·

1 Answer

vipullag-MSFT avatar image
0 Votes"
vipullag-MSFT answered

@arunkumar-8707

I tried your scenario in my lab environment and it is working as expected without any issues. I was able to stop the VM without any issues.

Below are the steps that you need to do to disable password auth in Linux VM.

Now, you have both ssh and password auth methods enabled on you VM.
In the below screenshot you see the 2 types of logins.

121856-l1.jpg


Once you are logged into the VM with ssh keys, use below command and modify the file sshd_config to make changes for two parameters PasswordAuthentication and PubkeyAuthentication to no and yes respectively as shown in below screenshot.

 sudo vi /etc/ssh/sshd_config

121872-l3.jpg

Restart the ssh service with below command

  sudo systemctl reload ssh

With this you will now be able to login to VM only with SSH keys.

Hope this helps.

Please 'Accept as answer' if the provided information is helpful, so that it can help others in the community looking for help on similar topics.




l1.jpg (79.7 KiB)
l3.jpg (32.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.