So how you get sudo passwd in linux?

Zebo

Elite Member
Jul 29, 2001
39,398
19
81
My MBP is in the shop for running too hot and I fired my old thinkpad up and can't install anything because I forgot password.. been about a year. I am running ubuntu and trying to watch youtube/

Moved from OT to OS
-ViRGE
 
Last edited by a moderator:

ViRGE

Elite Member, Moderator Emeritus
Oct 9, 1999
31,516
167
106
Linux isn't my strong point, but shouldn't Single User Mode do the trick?
 

Zebo

Elite Member
Jul 29, 2001
39,398
19
81
I don't have the passwd, thats my problem. when I boot no pass is needed however when it goes into screen saver or I want to be super user it wants passwd.
 

Fallen Kell

Diamond Member
Oct 9, 1999
6,119
482
126
When you log in the next time, open a terminal, and type "passwd" and it should ask for a new password. It may require the existing password, so you might need to reboot the system into single user mode, open a terminal, set the root password (using passwd), and then set your user password ("passwd <username>", without the <>'s). Then reboot out of single user mode.

If you don't know how to boot to single user mode, when at the grub screen, hit the "e" key, and then go to the line for the kernel and add the word "single" at the very end of the line (with a space between it and anything before it).

If the grub menu is password protected (it might be), you need to boot using a linux live CD, mount the partition/hard drive that has the "/etc" directory (to find the device name that your "/etc" is located before booting off the live CD by changing directories to that location "cd /etc" and then running "df -k ./" and the device/filesystem should be listed as the first option, if the device is something like "/dev/mapper/blahblahblah", it is in a Linux Volume Management (LVM) filesystem and you need to do a few extra steps after booting off the live CD, run "vgchange -ay", which should activate the LVM and create the "/dev/mapper" devices to allow you to mount the "/dev/mapper/blahblah" device), and edit the "/etc/shadow" file and remove any characters between the first and second ":"'s in the file for the root username and your username (example "root:xGHsk$821jk&43jkhrwd$.:14302:0:99999:7:::" , change to"root::14302:0:99999:7:::"). You can then reboot the system like normal and then set the passwords for root and your username.

You have just learned how easy it is to break into a linux system as well...
 
Last edited:

electroju

Member
Jun 16, 2010
182
0
0
Zebo, you should turn off the screen saver because it is not needed anymore. If you are using root in GUI, be careful. Anything that can happen will happen.

Notebooks gets hot because people wants the fastest processor. A small space like a notebook computer and using a fast processor will always have problems with heat. Slower processor works the best. It also helps to have a lower end graphics.

I am not going to repeat what others have said although Fallen Kell is messy on the information. The screen saver password is who ever is logged in. Typing in passwd on the terminal, will always ask for your new password. Though depending how your settings it may ask for the old password first before entering the new password.


If the grub menu is password protected (it might be), you need to boot using a linux live CD, mount the partition/hard drive that has the "/etc" directory (to find the device name that your "/etc" is located before booting off the live CD by changing directories to that location "cd /etc" and then running "df -k ./" and the device/filesystem should be listed as the first option, if the device is something like "/dev/mapper/blahblahblah", it is in a Linux Volume Management (LVM) filesystem and you need to do a few extra steps after booting off the live CD, run "vgchange -ay", which should activate the LVM and create the "/dev/mapper" devices to allow you to mount the "/dev/mapper/blahblah" device), and edit the "/etc/shadow" file and remove any characters between the first and second ":"'s in the file for the root username and your username (example "root:xGHsk$821jk&43jkhrwd$.:14302:0:99999:7:::" , change to"root::14302:0:99999:7:::"). You can then reboot the system like normal and then set the passwords for root and your username.

You have just learned how easy it is to break into a linux system as well...
This will not accomplish anything. It is best to mount all partitions to their designated directories and use the chroot command. Then change the password there. Deleting the line in /etc/shadow is not wise to do. It will break the setup if it is done wrong.