root password for CentOS-based 8.2 - Gen 1

2021-01-05T16:37:27.013+00:00

Hello,

I have created a VM and selected as image "CentOS-based 8.2 - Gen 1", but I don't know the root password for this Linux OS Image.

I can have root access right using sudo -i command but I need the password of root cause I need to transfer some files through WinSCP.

Is there any predefined root password or I have to reset it ?

BR,
Ilir

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

3 answers

Sort by: Most helpful
  1. JamesTran-MSFT 36,621 Reputation points Microsoft Employee
    2021-01-05T22:07:38.03+00:00

    @Tetra Solutions System Administrator
    Thank you for the detailed post!

    The root password when using "sudo -i" should be the one you set when you created your VM. If you need to reset your password:
    Navigate to your VM -> Select "Reset Password" under Support + troubleshooting -> Reset your password.
    53742-image.png

    53752-rootpass.gif

    If you have any other questions, please let me know.
    Thank you for your time and patience throughout this issue.

    ----------

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.


  2. Cristian SPIRIDON 4,476 Reputation points
    2021-01-05T22:13:18.31+00:00

    You should reset root password if you really need to login with root user - you should be able to do anything with the admin user you created initially.
    By default root user doesn't have a password (disabled for login).

    Hope this helps.

    0 comments No comments

  3. 2022-09-26T11:20:44.47+00:00

    You can easily reset the password by following below steps

    1. Login to VM via SSH using user created while you were deploying
    2. Use sudo -i to get root access
    3. Use command "passwd" and set new password.
    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.