What if Debian6 forgets the root password?

Source: Internet
Author: User
The installation was suspended because some problems had to be solved by the blogger during Debian installation. After the installation was completed, the root password % _

It is funny to say that the space I use is better than the space of other space vendors, but it is quite awkward to use it...

How can this problem be solved? Since it is a space rented by yourself, you can also customize it yourself (just like you rent a "Facade", You can decorate it yourself ..), but I cannot modify this space. I have to submit a service ticket and ask the Technical Department of the space service provider to modify it...

Alas, it was quite troublesome, so we came up with the idea of using VPS... However, it may be a little difficult to use VPS for children's shoes in a QQ group that I added. I was afraid that I would want to create a virtual machine if I thought I was not able to access the website, then install a Linux system and try to operate it. When you are proficient, you can use VPS again, which saves the inconvenience caused by the preliminary debugging...

So I immediately Installed Vmware Workstation9 and XXX based on what the blogger said... Alas, it's not easy to develop software this year ...), Then download the Debian ISO image...

However, due to some problems that the blogger had to solve during Debian installation, the installation was suspended. After the installation was completed, the root password % >_<%

Okay, I don't want to reinstall it (it's time-consuming, it really cannot hurt ...), Find a method to change the root password...

When the VM is started, press "e" on the Grub interface to edit

Add "init =/bin/bash" next to linux/vmlinuz"

Press Ctrl + X to start with the configuration you just edited.

In this way, we get a bash shell
Although the shell is obtained at this time, it is not feasible to change the password immediately because it is only in read-only mode.

Enter
mount -no remount,rw /
Mount to read/write mode

Enter
passwd root
To change the password. Enter the password twice. After confirmation, the system prompts Successful.

Enter
sync
Synchronize data to disk

Unmount
mount -no remount,ro /

Restart and complete. If you change the password of another user, replace the root user after passwd with the user name you want to change the password!

Okay, the root password has been changed, but it is troublesome to install vmware-tools... The prompt "locate gcc…" is displayed during installation to compilation... It wasn't like this before...

I was so dizzy when I asked du Niang... (In fact, I am almost dizzy ...)

Okay, go to Google. Well, it's good. The first one is. (well, to sum up, I don't know how to find Google ...)

Ctrl + C to cancel the installation... (Don't ask me why. Actually, I don't know = .)

Enter

su

Enter the root password to obtain the permission.

Install the gcc compiler

apt-get install gcc

 

If you have not installed the kernel header file, follow the steps below to install the kernel header file

Confirm kernel version

uname -a

Return

Linux shenqhy.com 2.6.32-5-686 #1 SMP Sun Sep 23 09:49:36 UTC 2012 i686 GNU/Linux

Whereshenqhy.comThe name of your computer2.6.32-5-686Yes kernel version

 

Query version information

apt-cache search headers 2.6.32-5-686

Return

linux-headers-2.6.32-5-686 - Header files for Linux 2.6.32-5-686

Install the kernel header file

apt-get install linux-headers-2.6.32-5-686

Wherelinux-headers-2.6.32-5-686Indicates the queried version.

 

OK. Install Vmware-tools again.

Decompress the package and go to the vmware-tools directory.

Enter the followingCommandTo install

CC=/usr/bin/gcc4.3 ./vmware-install.pl

Enter all the way. Wait for the installation to complete.

In fact, you can solve the problem by following the error message "select gcc path" in Ubuntu12.10 !!

Okay. Try again after the installation is complete. It's much smoother ~~!
Actually, I personally think it is the best choice to use virtual machines to practice hands before using VPS ~~ Of course, if you have the conditions, you can build your own VPS...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.