Date: Sat, 31 Jul 2010 22:37:58 -0600

From: William Astle <l...@l-w.ca>

To: clug-talk@clug.ca

Subject: Re: [clug-talk] how to boot without knowing any password

Message-ID: <4c54fa26.70...@l-w.ca>

Content-Type: text/plain; charset=us-ascii; format=flowed



On 10-07-31 09:12 PM, clug-li...@vlietwerkz.ca wrote:

  
Ubuntu and most of it's variants don't /use/ a root password though it

can be set if you really want.  The root password is not set by default

for security reasons.  The effect is that if an attacker attempts to log

in as root, they will have no success no matter how many times they try

because the root user is not /able/ to log in directly...



The proper method for Ubuntu / Kubuntu / etc. is to log in as an admin

enabled user - usally the user that was first set up - and use the

command line as such:



# sudo<whichever command/binary you want to use>

password:



The system will prompt you for the user's password.  The password is

hidden - in fact, no characters of any sort are displayed, so be careful

typing the user's password.  If they are set up as an admin and are also

in the "sudoer" file, then the application will(should) execute as root.

  A neat little trick I use to keep from having to type sudo all the time

is to run:



# sudo su -



It's a neat trick, but don't get in the habit of doing it all the time -

it's bad muju.

    


Or you could just use "sudo -i" which accomplishes the same thing.



Of course, none of this helps if you can't log in in the first place 
because you don't know ANY password on the system. This is the case in 
the original query.



  
All variants of UNIX, including Linux, have a "single user" mode which 
you can always get to provided you have access to the physical console 
of the machine. Single user mode is basically "init 1" with no GUI and  
minimal file systems mounted but enough to do necessary repairs as root 
to get your system running. You usually get to single user mode by 
interrupting the boot process and editing the boot string to append 
"single" to the kernel parameters and maybe adjust a few others.



Ubuntu has dumbed down this process a little by adding a "recovery" item 
on the Grub boot menu. If you don't see a grub boot menu on startup, 
press esc after BIOS initialization and it should appear. The recovery 
boot starts a sub menu with one of the options being to go to a root 
shell. Select this option, then do the following commands:

 adduser <your userid>

 reboot



The adduser command will prompt you for a password and some profile info 
.  Upon reboot  you should be able to enter the new id/password  combo 
to get access to the system and  keep the Ubuntu security  model in 
place whereby you  enter your own password to SUDO commands or  system 
modification prompts rather than a real root password.



I tested this successfully on Ubuntu 9.04.  Ubuntu 10.4 uses an updated 
Grub which I haven't used for a while, but hopefully it still has the 
recovery boot option.  If you google "Ubuntu lost password" you'll find 
other creative ways to get around this issue.



Good luck!



Greg







_______________________________________________
clug-talk mailing list
clug-talk@clug.ca
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to