Posts Tagged ‘absolutely’

Recover lost / forgotten root password for CentOS 7 Linux / Boot CentOS 6 into Single User mode to reset admin pass

Friday, September 27th, 2024

centos-community-enterprise-operating-system-logo.

If you have some old CentOS 7 Virtual machine hanging for a long time and you don't remember the root password or you don't remember where you have stored it, but you have something important as data left over, you might need to recover root password for your CentOS 7 Virtual Machine.

I recently had to resolve that issue and here is the few easy steps to take to recover the lost root password.

Assuming you have tried to boot the VM and the VM boots fine and your few attempts to input manually some default passwords of yours failed, next 

1. Reboot the Virtual Machine to the GRUB boot menu

 

grub.png

The GRUB boot screen should appear and be there for few secs

2. Edit the boot loader kernel options ( add add rd.break enforcing=0 )

 

How to reset root password on CentOS Linux - Clouvider

Press 'e' to Edit the boot loader and modify the boot commands options passed to the linux kernel.

In GRUB edit mode:

add rd.break enforcing=0


to the end of the line starting with linux at the end of passed parameters list as shown in the picture.

When done editing, press Ctrl-x (Control button x key simultaneously) to boot with changed parameters.

ALTERNATIVE WAY TO BOOT THE SYSTEM INTO ROOT WITHOUT PASSWORD PROMPT:

Alternative options to use instead of add rd.break.enforcing=0 are to substitute the rhgb quiet kernel option with init=/bin/bash

Edit CentOS Grub Boot Menu Entries rhgb quiet options shot

Modify kernel parameters pass init=/bin/bash to kernel to boot emergency mode centos linux

 

As you might wonder for the meaning of the passed 2 parameters:

rd.break breaks the boot process at initramfs while
enforcing=0 disables the SELinux (which often enabled by default on CentOS).

Another way is to 

3. Boot in CentOS emergency mode and Reset the root password
 

When done editing, press Ctrl-x to boot with changed parameters.

As you might wonder for the meaning of the passed parameters:

rd.break breaks the boot process at initramfs while
enforcing=0 disables the SELinux (which often enabled by default on CentOS).

Whence system boots up with the modified kernel options cmd, the switch_root prompt will appear.
As the emerency mode boots the filesystem into read-only mode under /sysroot default directory, in order to be able to
modify the MD5 root password stored hash inside RO mounted /sysroot/etc/shadow you need to remount the Filesystme
in read-write mode.

To Remount the read-only file system /sysroot in write mode:

# mount -o remount,rw /sysroot

As the /sysroot is not the root directory to be able to use a standard passwd command you need to make /sysroot
as the default root folder for the booted linux by chrooting into it.
 

  • Generate MD5 password manually (for Hardcore masochistic admins 🙂 )

If you're a hard core linux sysadmin of course, generate your own new md5 password and directly modify /etc/shadow copy pasting the md5 string.

If you want to manually generate the md5 string, you can do it depending on the required encryption algorithm with:

For (md5, sha256, sha512) encrypted pass

# openssl passwd -6 -salt xyz  yourpass

For   (md5, sha256, sha512) encrypted pwd

# mkpasswd –method=SHA-512 –stdin

For (des, md5, sha256, sha512) encrypted pw

# perl -e 'print crypt("YourPasswd", "salt", "sha512"),"\n"'


Once the string is generated;

# vim  /etc/shadow


and exchange the old with new string for MD5

  • Change password with chroot (the easy common way)

remount read write the filesystem in emergency single user mode CentOS LINUX

# chroot /sysroot

That should drop you into another shell bash-4.x

 

Reset root user password in CentOS 7

# passwd
Changing password for user root.
New password:
Retype new password:

We need have to sync the entire filesystem we have to use the sync command, for novice sys admins who never heard about this command, below
short description:

The Linux sync command synchronizes cached data to permanent storage.
This data includes modified superblocks, modified inodes, delayed reads and writes, and others. sync uses several system calls:

sync()
syncfs()
fsync()
fdatasync()


For example, the sync command utilizes the sync() system call to write all buffered modifications to file data and metadata to an underlying storage device.

As a Linux systems administrator or developer, understanding the sync command can be crucial for efficient file synchronization. Additionally, sync can be helpful after crashes or when the file system becomes corrupted.

In this tutorial, we’ll explore the various aspects of the sync command. Also, we’ll see how we can use sync in different scenarios.

# sync

# exec /sbin/init

Try out the root password after booting normally into CentOS and the new set administrator pass should work.


Resetting forgotten (lost) root password on CentOS 6

The process is absolutely the same except on the Step 1 (in the modification of GRUB boot menu by pressing e key), add to

rhgb quiet

at the end one 'S'

This S character means 'boot CentOS into Single user mode'

rhgb quiet S

 

Go to single user mode on CentOS 6 Linux in boot loader S kernel setting

Then, press ENTER key and press b key to boot CentOS 6 into to single user mode.
 

What is it like to become a father in the Age of Coronavirus Pandemics – Our baby Dimitar is born

Thursday, June 4th, 2020

After a long 9 months finally on 12.05.2020 12 of May 2020 by God's grace our baby Dimitar was born. He born one day after Saint Cyril and Methodius feast in the Church on the Church Feast of Saint Ephiphanius of Cyprus, Saint German Patriarch of Constantinopol a fierce fighter for the veneration of Holy Icons, Saint martyr Ermogen patriarch of Constantinople (according to new style Calendar) and Saint Basil of Ostrog (in old calendar) . I always loved spring and especially month of May so I'm happy the baby born exactly on this month. For many 2020 broght the coronavirus pandemics brought a lot of pain and surely for us it brought an extra stress with all this mask wearing and super extra precaution measures everywhere and self-isolation but for me 2020 brought me a great joy and a good things in life, after we changed the rented apartment and we moved from Mladost 3 to Geo Milev (a district that is much more fitting my temper), now just 4 months later we have this greatest joy of having a son, something that many people dreamed all their life and suffered. For us it was about 6 years without a baby and the lack of a child in a family seems to extra strain situation. I do suffer and pray for all those people who can't have child and desperately want it and I hope God will bless many with the same joy in the coming years. I have to say having a baby fills up a great hole in the family and brings up new horizons for development of both families and the new born child. Most importantly a new opportunity is there for a new man to get into the kingdom of Heaven know Christ and hopefully end up in eternal blissfulness in Heaven with all the saints by the mercy of God. If you think for a while how all of us some time back in time were also a kid and how our mothers had many sleepless nights and feared for our health and well-being and how from a small baby we become a man who studied excelled in things, failed in others and have the opportunity and rationality to do complex things such as writting this article you get into the conclusion all this is hard to believe mind blowing miracle …

Baby-Dimitar-selected/New-man-born-into-the-world

Right out of Mother's Belly seeing the Light of the World for a first time – First Picture of the Baby before he officially had a name

Many people prayed for the easy birth of my wife as she is already 36 years old and in that years sometimes giving birth is dangerous and often many woman loose babies or are forced to be cut for the baby to be delivered from the belly with Caesarian section cut. Svetlana give a normal birth thanksfully and she delivered the baby for just 3.5 hours after she was accepted in hospital the previous day and doctors did an infusion of oxytocin  (a liquid hormone that doctors use to acccelarate the birth process when the baby was over carried just like it was in our case and in the case of many woman) – Svetlana overcarried it with 5 days.

After a long struggle with my wife on selecting the name, we finally named our new born baby Dimitar  born 49 centimeters / 2980 grams / Dimitar was named in honour of one of the most notorious and loved saints in the Eastern Orthodox world Saint Demitrius of Thessaloniki after a very long struggle to select the name as my wife Svetlana desired to name him Daniil (Daniel), a name which is also beautiful and belongs to the Prophet Daniel and Saint Daniel the Stylite. Svetlana had some weird ideas to name the boy Elijan (Ilia) as well as some other ideas for names like Andrei (Andrew) a very beatiful name belonging to Saint Andrew the Apostle who by the way preached on the Bulgarian Sea Coast according to Church tradition I was against not because the names are bad but because I wanted strongly to follow our well known tradition in Bulgaria to name the first born male boy after the grandfather in that case I wanted to name baby Dimitar firstly in favour of Saint Dimitar (The Myrh Bearer) of Thessaloniki to be the heavinly guide of the boy together with all the other saints under the  Demitrius / Dimitrius name as well as to venerate my father who is a very hard-working and patient parent even over the years with a such a wild child which I am.

Holy Relics of Saint Demetrius the Myrh Bearer in St. Demetrius Basilica in Thessaloniki (Greece)

Saint-Demetrius-the-Myrh-Bearer orthodox holy icon

Saint Demetrius killing Lyaeus the Glariator (depicting the spiritual destroyment of paganism by prayerrs of Saint Demetrius and a remembrance of fact that Christian Nestor killed much powerful Gladiator Lyaeaus who killed thousands of Christians on the Arena before by the all powerful prayers of Saint Demetrius)

I find worthy  to name a few of the other kid's heavinly prayer intercessors this is the well known Russian Saint Dimitrius of Rostov, The bulgarian saint Saint Demitrius of  Besarabia (an ex-territory of Bulgarian Empire) and Saint Dimitrij Donskoy, there is even more saints undet the Demetrius names canonized by the church over the centuries.

The name selection of a boy turned to be much more complicated than I thought and for anyone out there that has to go through the process of awaiting a new born I recommend you to select the name in advance as selecting the name after birth in negotiation with a woman who gave birth is a terrible and hard to bear experience as her hormones are making swing moods every now and then.

/pictures/Baby-Dimitar-selected

Selecting a kid name in the past was quite an interesting process and there was various approaches here in Bulgaria, from naming the kid after a grandfather, grandmother to naming it after a big saint if he is born on a big saint's Church feast day for example if it is born on 6th of May (saint George's day) in Bulgaria it is common to name the kid Georgi or if it is Saint Cyril and Methodius Cyril.
Due to the fact the kid was born near the feast of Saint Apostole Simon the Zealot one of the names I suggested to Svetlana was Simon or Simeon even though that name was not my choice as a compromise that might fit us both. We had some discussion and we both liked the Kiril (Cyril) name, plus 11 of May was Saint Cyril and Methodius but I had an internal tension about it as we didn't have anyone in family called Kiril.

Baby-Dimitar-doctor-checks-heart

Heart works perfect Praise the Lord ! 🙂

Finally my wife stepped back and she agreed to write the name in birth register the name Dimitar so now the kid in his Birth Certificate  is Dimitar Georgiev Georgiev.

Giving birth in Pandemics prevented me to be able to go and see the child until the day he and wife was discharged from Sofia's Maichin Dom University's hospital as clincally healthy.
Please excuse me if I'm turning your attention from the common IT themes Religion and Philosophy which I talk about but I thought putting a few lines for a life changing event as a baby birth is important for me personally to organize things in my head.

/pictures/Baby-Dimitar-selected

The little Big Man

The stress around the baby born is always a big deal both for the mother and the father. But in my case thanks God I was relatively calm. The feelings in the days around birth for the father are quite extreme of course and perhaps this is why many fathers drink till forgetfulness after the baby is born. This however was not the case with me, even though due to the spiritual hardships I have a drinked a couple of beers overall I stayed sober around the birth and right after it before the baby came home.

/pictures/Baby-Dimitar-selected

In front of the Prayer Chapel in Maichin Dom (where yearly the Patriarch of Bulgaria Neofit sanctifies the place with Vodosvet (Sanctification of the Water)

Talking about taking the baby I'm thankful to my dear Friends Angel / Krasimir his wife Irina and Mitko Ivanov, who were the only person to kinda of support me and come for the official dischargement ceremony in hospital. I had to organize a couple of things for the dischargement pay the bills currently in Maichin Dom the overall birth expenses for doctors, midwives, hiring room expenses (for 8 days hospitalization) was lets say normal 1345 LEVA  (~ 700 EURO) much lower price than in other non-government funded hospitals in Sofia like Nadezhda  where it would have been about 2300 LEVA, this is of course higher than social countries of Western Europe like Germany where a normal state funded birth would cost something like ~ 350 – 400 EUR but still very cheap if Compared to United Stateswhere a good orchestrated birth costs something like 25 to 30 000 USD.
As I heard from wife the birth experience she got was of course harsh but this is normal for the first baby where the levels of stress and uncertainty is absolutely unbearable for the your unexperienced parturient mother.

I have to express my sincere thankfulness to the great Head Doctor Miss Ivet Raicheva thanks to whom my wife succeded in normal birth and we have a healthy baby.as well Doctor Nikolay Gerdzhikov from Hospital Second Baby Specialized Hospital Sheinovo who  break off the amniotic fluids baloon of my wife to accelarate the overcarried baby timely birth, as well as all the pregnancy tracking doctors of UMBAL Nadezhda (A Hispital for Woman Health).

Just like I thank warmly to all the people who have given us baby clothes, baby car chairs, subtrates, carriage cangoroos and all kind of baby toys and equipment useful in raising the baby as well as all the friends who helped with advices during the pregnancy and many hardships in this 9 months before baby come to earth and after that. This are Mitko Paskalev, Mitko Ivanov / Anastasia, Krasimir, Hristina, Father Stoyan and his wife Yanna, our godfather Familiy Galin and Andrea, uncle Emilian, Vasil Kolev, Father Flavian and all others who helped us with warm prayers and good words during the hardships of pregnancy during the Coronacrisis.

Due to the Covid, every time I had to go to the hospital to bring my wife food, pampers, fruits etc. was only possible to be delivered by a medicine personal (with a small treatment fee) as entrance of externals like me was not possible.

I did not have the chance to go inside the hospital's 12th floor to pick up my wife with the baby due to the COVID-19 Virus, hospital entrance was only allowed to the parter stage and only after they check your temperature with an electronic wireless gun-like thermometer headed right in your head …
I had to then wait with the few bouquet of flowers, chocolate candys and alcohol to hand in to the main degenerating doctor which in our case was Ivet Raicheva, I have to kindly thank this professional woman for doing all the best for my wife in assisting her in birth and succeeding in a normal birth process which in our age is quite rare about at least 80% of woman give birth with a C-Section.

Baby-with-Angel-Krasimir-Irina-and-Mitko-Ivanov

Friends and Brothers / Sisters from the Church Angel, Krasi, Irina and Mitko Ivanov

/pictures/Baby-Dimitar-selected/Baby-Krasi-Irina-and-Sveta

Krasimir and Irina

/pictures/Baby-Dimitar-selected

In front of Maichin Dom Me seeing my boy for a first time !

After Svetlana was accompanied in the entrance stage with a medicine worker, we made the standard few remembrance pictures on the floor and infront the hospital and on a Volkswagen Taxi headed home with the baby being in fear for the baby in every car bump.

aking-the-baby-home

The great joy of blessing to be with your Son for a first time

Once Dimitar was already home we rejoiced and placed him in his already prepared baby crib and left home wife for 40 minutes together with the baby and went out to for a quick treat for friends who were so kind to come for the baby.
The routine afterwards is expected as to every new born, a lot of breast feeding for wife, adaptated milk sometimes, changing pampers, baby bathing every day, swinging, singing songs to calm him down when he songs etc.

Baby-Dimitar-selected/Baby-Dimitar-Svetlana1

The responsibilities for the father of course suddenly rise as you have to be a products supporter as your wife is quite weak over the 40 days after birth, you have to clean, buy food or prepare something to eat, prepare her a breastfeeding teas, confort her and calm her. But the overall it is clear that the woman becomes much more stable version of herself after the birth she starts thinking more to the ground and dream less in fantasies as the baby helps her better see the reality and learn to sacrifice more.

Georgi-Baby-Dimitar

Let God bless and protect Dimitar by the prayers of the Holy Virgin Mary Theotokos and All Sains and help him in all the hardships from the cradle to a fully grown and wise man that he'll become one day by God's mercy!

An absolutely must have installed packages to have a complete Ubuntu / Debian Desktop

Saturday, September 19th, 2009

Every time after installing a plain new Debian or Ubuntu system, I feel ridiculous cause of the fact. That many of the programs I do use in my daily work with my pc ain’t there ready to use. In that manner of thoughts it’s really really irritating for me to try to memorize the whole list of programs I usually use not to mention that I hardly could remember the exact name of the packages containing the programs. Moreover it’s really irritating to type a hundred times
apt-cache search programname;
apt-get install programtoinstall;
.To make my daily life and hopefully my blog readers life easier I’ve decided to make a list of all the packages to install:
here is the one liner command required to install the whole heap of packages
$ apt-get install flashplugin-nonfree gstreamer0.10-plugins-ugly libxine1-ffmpeg vlc mozilla-plugin-vlc mplayer wifi-radar extremetuxracer powermanga supertux chromium kbedic transmission openoffice.org deluge alltray xine-ui dodgindiamond2 zblast-x11 blobwars briquolo kamefu blender inkscape gftp xchat k3b gnochm tecnoballz audacious audacity rezound opencubicplayer virtualbox gnomad2 kino grip xawtv cheese mozilla-helix-player abiword bgoffice-computer-terms sun-java-fonts sun-java6-jdk sun-java6-plugin sun-java6-source sun-java6-jre sun-java6-demo dia gajim mc dpkg-dev amsn elinks lynx iptraf sniffit ettercap wireshark bluefish thunderbird screenlets verse bible-kjv dict-easton gnomesword sword-text-kjv realplayer pidgin ncurses-dev cbedic awn-manager centerim-utf8 apachetop alsa-oss oss-compat iftop
For your convenience I’ve also prepared a small shell script I’ve called desktop-bundle.sh download desktop-bundle.sh here
Just in case if you’re wondering what exactly is the above package bundle installation good for.
Here is a few explanatory notes next to it:

mozilla-plugin-vlc – Allows mozilla to play in embeded player various video files

gftp – Gnome’s FTP client

xchat – IRC Gnome Chat program

cheese – A program to make pictures and suchalike

k3b – kde’s cd burner

kino – video editor

sun-java6-jdk, sun-java6-jre, sun-java6-plugin – allows you to run properly java applications on your Linux system both from the command line and in browser

screenlets – explained in my previous post here

wifi-radar – a gnome wifi detection and connection tool

cbedic – a bulgarian / english console dictionary I heavily use

dia – Diagram drawing software (handy to draw your for instance network diagrams)

kbedic – kde Bulgarian / English dictionary. To make it work properly you’ll need also the bedic data files, which could be downloaded here

verse, bible-kjv, gnomesword – This and the rest bible related packages are a nice packages I use to daily read and research the bible, since I’m an Orthodox Christian

vlc – Nowdays I’m changing in using vlc to watch videos since mplayer is getting more and more old fashioned and it’s behaviour is a bit disappointing sometimes

gnomechm – An app to read Microsoft’s CHM help file

grip – Program to RIP audio files

opencubicplayer – the good old Cubic Player we all enjoyed in MS-DOS and Novell DOS to play various XM, S3M, MOD, IT etc. files, it’s really nice that this version supports MP3 file format

audacity – An application to record sounds, supports songs sound reverse, for example you can use it to listen your mp3 files backwards, let’s say to check if a song contains a satanic message or not 🙂

dosbox – dos emulator to run old school dos games I love this one

inkscape – 2D vector design software

blender – 3D design software

gajim – might need that one in case if you intend to use Jabber

pidgin – the program I use as an ICQ, MSN client

transmission, deluge – nice bittorrent softwares

kompozer, bluefish – editors similar more or less to the famous dreamweaver. kompozer is more advanced and is much closer to dreamweaver

virtualbox – The Sun’s Virtual Machine substitute for VMWare, works okay maybe 20 or 30% slower than VMWare

rezound – again a nice sound editor, like audacity

xine – video player, most people who remember the times before few years should know it

amsn – MSN chat client

avant-window-navigator – A MacOS X like panel for the GNOME Desktop. Features a taskbar behaving similar to Mac OSX’s dock.
There is one drawback it doesn’t support the dock to be positioned anywhere except on the bottom of the screen
chromium, supertux, powermanga etc. – this and many of the rest are nice games I love to play every now and then when I get completely pissed off

Well that’s all for now. Hope this post would be interesting to somebody out there.

END—–