Reset Lots Password

Support for security such as Firewalls and securing linux
Post Reply
matrixdude
Posts: 1
Joined: 2022/12/20 16:00:48

Reset Lots Password

Post by matrixdude » 2022/12/20 16:03:09

I inherited a CentOS 7 virtual machine on VMware ESXi. The previous admin team lost the password for root, what is the easiest way to recover or reset the root password, keeping in mind is a VM and I do not have the luxury of sending proper physical keyboard combinations to the VM :-(

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Reset Lots Password

Post by TrevorH » 2022/12/20 16:45:14

Unless you have a normal user with full sudo access (e.g. part of group 'wheel') then you will need to reboot with access to the machine's console. For assistance with recovering a lost or forgotten root password please see https://wiki.centos.org/TipsAndTricks/ResetRootPassword links to a RH article on how to do this correctly.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Reset Lots Password

Post by jlehtone » 2022/12/21 09:24:38

The essential step that the access to console enables is mounting of a filesystem without actually loading the installed OS.
On physical machine one can boot install media in rescue mode to achieve the same.

The "system image" of some VMs can be mounted by the host too. Is VMware one of them?
An alternative to running "passwd" in chroot is to add SSH public key into /root/.ssh/authorized_keys
Then ssh connection as root could be possible and root can run "passwd".

Post Reply