After I had upgraded the openshh version done this step. I am unable to access the my azure VM through terminal and serial console why. What are the solution for this? And when connect through the terminal by ssh key it asking password. unable login to vm

SANTHOSH KUMAR KUZHANTHAIVEL 20 Reputation points
2024-07-12T08:39:03.0833333+00:00

After I had upgraded the openshh version done this step. I am unable to access the my azure VM through terminal and serial console why. What are the solution for this? And when connect through the terminal by ssh key it asking password. After given password permission denied or login incorrect.

To Install the vulnerability patched ssh server 9.8p1 on Ubuntu: download it:

wget https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.tar.gz

Remove the existing install:

sudo systemctl stop sshd

sudo apt-get remove openssh-server openssh-client

Install the build tools:

sudo apt update

sudo apt install -y build-essential zlib1g-dev libssl-dev libpam0g-dev libselinux1-dev libwrap0-dev libedit-dev libbsd-dev autoconf automake libtool pkg-config wget curl git

Untar it, build it:

tar zxvf openssh-9.8p1.tar.gz

cd openssh-9.8p1

./configure

make

sudo make install

Setup the service:

sudo nano /etc/systemd/system/sshd.service

Paste this into the file:

[Unit] Description=OpenSSH server daemon After=network.target [Service] ExecStart=/usr/local/sbin/sshd -D ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure [Install] WantedBy=multi-user.target

Save and close (ctrl+x y enter)

Reload the daemon, start and enable the service:

sudo systemctl daemon-reload

sudo systemctl start sshd

sudo systemctl enable sshd

Now I had problems at this point, but all I needed to do was unmask ssh:

sudo systemctl unmask ssh

Then repeat the daemon-reload, start and enable Check the status:

sudo systemctl status sshd

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,001 questions
0 comments No comments
{count} votes

Accepted answer
  1. deherman-MSFT 37,416 Reputation points Microsoft Employee
    2024-07-12T16:54:07.5566667+00:00

    @SANTHOSH KUMAR KUZHANTHAIVEL

    This is not the method you should use to update SSH on your Azure Ubuntu VM. The correct method would be to run sudo ``apt update && sudo apt upgrade. You will need to restore the VM from backup or attach the OS disk to a recovery VM and reverse the configuration in chroot environment. It will probably be helpful to have a VM with the same OS so you can copy the configuration from it. In the future, please follow the patch instructions supplied from Ubuntu or Azure and avoid installing packages like openssh from source unless required. If you are doing vulnerablity patching you can check here for instructions.


    If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you for helping to improve Microsoft Q&A!

    User's image

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. SANTHOSH KUMAR KUZHANTHAIVEL 20 Reputation points
    2024-07-16T10:10:36.68+00:00

    So ,there is any other way to solve this problem.if there is other way would explain

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.