LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-12-2009, 12:13 AM   #1
vibinlakshman
Member
 
Registered: Dec 2008
Location: Kerala, India
Distribution: Ubuntu 11.10
Posts: 334

Rep: Reputation: 33
Wink How to reset password ?


Any body knows how to reset a root password after inserting a live cd,
ie . i need to reset my existing ubuntu root password, other options all i tried its gud , but need to knw hw to do this while having a live cd and resetting it !!!!!!
 
Old 01-12-2009, 12:32 AM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Just google 'how to reset root password using live cd'
 
Old 01-12-2009, 01:19 AM   #3
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

Rep: Reputation: 40
Yeah, google it, and post back here if you don't find the information you need. If you find the information you need, I guess you should paste in the link here on this thread to help out others later on.
 
Old 01-12-2009, 05:02 AM   #4
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
Once your live cd is up, mount your root partition (if it's still not mounted), for example, on /mnt/sda1:
Code:
mount /dev/sda1 /mnt/sda1
and edit (as root) its /etc/shadow (file where passwords are stored) with your prefered text editor:
Code:
nano /mnt/sda1/etc/shadow
Now, go to the line that begins with 'root' (normally the first) and look between the two firsts semicolons (':'). It should look something like this:
Code:
root:$3$kjhsSJSKSSjuiljs:13895:0:99999:7:::
The bold part is the encrypted password. If you delete it, you will reset the password. If you want to put another password instead, you can copy some from the working shadow file (real /etc/shadow) just after changing it with /usr/bin/passwd .

If you normally login to root with sudo instead of su or direct root login, you'll need to delete your user password instead of your root password (normal behavior with ubuntu, ie, look for the user you created with the installation/the user you normally use).

Once you deleted/changed the right password, you can reboot without the live cd and login and, if you want, reset to the definitive password with /usr/bin/passwd once you gained root privileges (or not if you use sudo instead of su/direct login).

Hope its useful!!

emi
 
Old 01-12-2009, 10:06 AM   #5
vibinlakshman
Member
 
Registered: Dec 2008
Location: Kerala, India
Distribution: Ubuntu 11.10
Posts: 334

Original Poster
Rep: Reputation: 33
Cool U r so cool buddy

Hey emi_ramo u r really a stuff.. Thanks for the help, except that mounting of root partition i thought of it, u really helped me lot buddy
 
Old 01-12-2009, 10:10 AM   #6
vibinlakshman
Member
 
Registered: Dec 2008
Location: Kerala, India
Distribution: Ubuntu 11.10
Posts: 334

Original Poster
Rep: Reputation: 33
Wink one more

useful link to others who really need to explore
http://www.linuxforums.org/security/..._password.html
 
Old 01-12-2009, 10:44 AM   #7
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
Hi again, vibinlakshman.
Normally, live CDs give automount facilities for the partitions on the PC they're running on. If you found out your system /etc/shadow (where ever it was), it was because the live CD did the work for you.

If you couldn't mount your system root partition, it was probably by one of these reasons (or all of them):
* Your hard disk is an IDE disk: it should be named /dev/hda instead of /dev/sda
* Your system disk is not the firs: it should be called /dev/sdb, /dev/sdc...
* Your system root partition is not the first in the disk: it may be called /dev/sda2, /dev/sda3...

For disk discovering, you can use this simple command :
Code:
ls /dev/{s,h}d??
For partition discovering, you can use fdisk or df to discover which is your system root, or just mount them all and look inside them.

See you!!
emi
 
Old 01-12-2009, 10:54 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Some systems won't allow sudo or let root log in with a zeroed root password. If you find this is the case, you could copy your regular user's password hash for root's. Then boot up normally and use your own password to run "sudo passwd" and change roots password.
 
Old 01-12-2009, 08:33 PM   #9
jglen490
Member
 
Registered: Apr 2002
Location: The next brick house on the right.
Distribution: Kubuntu 18.04, Bodhi 5.0
Posts: 691

Rep: Reputation: 45
So, I guess the next logical discussion point is "How-to prevent unwanted intrusions into /etc/shadow". Protecting passwords is a crucial, but not only, security issue. If it's this easy to break a system's security, what might be the next countermeasure.
 
Old 01-12-2009, 09:44 PM   #10
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by jglen490 View Post
So, I guess the next logical discussion point is "How-to prevent unwanted intrusions into /etc/shadow". Protecting passwords is a crucial, but not only, security issue. If it's this easy to break a system's security, what might be the next countermeasure.
Agreed. I'm quite concerned with how easy it is to change the root password in this way. Is there a way to prevent or at least make the process harder?
 
Old 01-13-2009, 07:56 AM   #11
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

Rep: Reputation: 40
As long as one has physical access to a linux box, resetting the root password is the easiest thing. Of course, there are quite a lot of measures one can take (password on BIOS, etc), but there will always(?) be ways to work around them. So keep your hardware locked up somewhere, and focus on software based security measures.
 
Old 01-13-2009, 10:18 AM   #12
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
Encrypted partitions and no auto-boot

Hi every one!!
If you can not physically lock your computer, you can always password lock your BIOS and your Boot loader (LILO, GRUB, etc) and crypt lock your system partition(s). With that, every time your computer starts up, it may ask for passwords to decrypt partitions. This is (I think) a good security enhancement, but will always be more options to get inside your system:
  • If some one opens your computer and resets the BIOS, BIOS password will disappear (not at all necessary: I've seen some new machines with BIOS reset button accessible from outside the machine!)
  • If some one boots your computer up with a live CD, Boot loader password is just skipped
  • If some one takes your Hard Disk and plugs it on a different machine, BIOS password is also skipped
  • If some one has a powerful machine, will be able to --force brute-- break your partition(s) password(s) and be able to read and modify your passwords on /etc/shadow (hard work, but possible). Also, encrypting disks may --will!-- decrease system speed.
I think that complete security is impossible. You can only make things harder for possible intruders. And this is true --and will remain as is forever, I think-- for all operating systems: If someone can enter the system (as you will), anyone with enough informatics knowledge/power will also be able to do.

Am I wrong?
emi

Edit: /etc/shadow protecting issue has always been a crucial issue for system developers and admins. Whole linux security system is enhanced to prevent /etc/shadow reading and writing and, still more, passwords are encrypted to prevent a little more intrusions on that. Hackers know that and will usually look for system holes to obtain root access to your computer, sometimes just to be able to read /etc/shadow and then be able to force brute break its passwords, sometimes to directly do whatever they are looking to do on your computer (as read sensible data or move a satellite to wherever they want ).

Last edited by emi_ramo; 01-13-2009 at 10:25 AM.
 
Old 01-13-2009, 08:49 PM   #13
jglen490
Member
 
Registered: Apr 2002
Location: The next brick house on the right.
Distribution: Kubuntu 18.04, Bodhi 5.0
Posts: 691

Rep: Reputation: 45
Somewhere between common sense (strong passwords, physical protection) and supergluing your CD drive shut, is that place where comprehensive security provides enough reasonable protection for whatever information may be permanently stored on your PC.

And sometimes you just need to be careful with what is actually in permanent, on disk storage. Strong encryption on specific files, very sensitive information kept separate from your actual PC, very strong passwords changed at intervals all work to make it more difficult to get your information - but not impossible for the truly persistent thief. It does narrow down the list of those who will take the time to get to your information.

Where I work, we use token authentication or strong and long (15 character minimum) passwords with frequent, enforced changes. The workstations are in protected, limited access areas with the servers in more highly protected, even more limited access areas. There are other security measures, too, on physical access using small devices. This does not prevent all surreptitious attempts or stop the occasional, though limited intrusion, but it does support high accessibility. For you and me, that's a bit extreme and certainly a very expensive solution.

Still we have important information that we ought to protect. So what else do you think you and I can do?
 
Old 01-13-2009, 08:59 PM   #14
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I've read that many sysops will remove the cable for the cdrom device for servers. They don't want someone accidently leaving in a cdrom and have the system fail to reboot, or have reads of a faulty cdrom bog down the server. This is in an access controlled server room.

Remember that USB devices can be used to boot as well on many systems. If you want to prevent that, you could disable the ability in BIOS and password protect the bios. Allowing USB keyboards & Mice but not allowing using a usb pendrive is trickier. Perhaps disabling vfat, ntfs and usbstorage when building the kernel would do it for most people. Using PolicyKit may be better. Or both for layered security.
 
Old 07-07-2012, 12:05 AM   #15
rbdharnia
LQ Newbie
 
Registered: Nov 2010
Location: haryana,india
Distribution: fedora
Posts: 5

Rep: Reputation: 0
Thumbs up tool to reset password

u need to use passwd command to change your root password.

and here are the list of other password related tools which may be helpful to u.

http://linuxhelp-rbdharnia.rhcloud.c...jsp?namex=pass
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reset Root password hbenway AIX 9 08-19-2008 04:13 PM
How to retrieve( or reset) root password in Mandrake Linux, as I forgot my password? Reghunath Linux - Software 4 05-08-2008 04:11 AM
reset password duki Linux - Newbie 5 09-05-2007 04:12 AM
Password reset hongman Linux - Newbie 2 07-11-2005 05:46 AM
reset the password ust Linux - General 1 02-11-2004 06:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 07:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration