smilen65
Posts: 1
Joined: Thu May 02, 2013 12:12 am

What is the root password for wheezy?

Thu May 02, 2013 12:33 am

I cant believe I cant find the answer anywhere. I'm soo sorry for asking, I've searched this forum for at least an hour looking. I just got my pi and I am fairly new to linux distros so maybe I'm just missing something obvious. Any help would be much appreciated.
Thanks,
Robert

User avatar
Jessie
Posts: 1754
Joined: Fri Nov 04, 2011 7:40 pm
Location: C/S CO USA

Re: What is the root password for wheezy?

Thu May 02, 2013 1:39 am

There isn't one. Root is diabled by default on Debian based distros. If you need to be root for something putting in "sudo su" at the command line will make you root.

W. H. Heydt
Posts: 10883
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: What is the root password for wheezy?

Thu May 02, 2013 5:04 am

Jessie wrote:There isn't one. Root is diabled by default on Debian based distros. If you need to be root for something putting in "sudo su" at the command line will make you root.
Or "sudo su -" if you want the root environment.

plugwash
Forum Moderator
Forum Moderator
Posts: 3454
Joined: Wed Dec 28, 2011 11:45 pm

Re: What is the root password for wheezy?

Thu May 02, 2013 7:47 am

Jessie wrote:There isn't one. Root is diabled by default on Debian based distros.
No it isn't. It is the default on ubuntu.

The raspberry pi foundation decided to go for the ubuntu approach of a locked out root account and sudo in their debian and raspbian images. This descision has nothing to do with either debian or raspbian.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: What is the root password for wheezy?

Thu May 02, 2013 10:44 am

It isn't locked out, it just doesn't have a password, so by default you can't login as root. Easiest thing in the world to give root a password so you can login with it. Of course if I told you how to do it they'd be calling for my execution on here......

Just google 'enable root password' anything pertaining to the Pi or Ubuntu will probably work.

Image
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
jojopi
Posts: 3084
Joined: Tue Oct 11, 2011 8:38 pm

Re: What is the root password for wheezy?

Thu May 02, 2013 11:11 am

Even if having no root password is not the default in Debian (which is debatable) it is certainly a fully supported option.

There is special support in the Debian installer for the necessary configuration of sudo, and in the Debian version of sulogin to avoid asking for a root password in single user mode if there is not one.

By contrast, there are still distributions where a root password is mandatory.

dr_d_gee
Posts: 84
Joined: Fri Jan 04, 2013 1:30 pm

Re: What is the root password for wheezy?

Thu May 02, 2013 12:30 pm

Indeed, and there seems to be a divergence of opinion as to which is the best/safest option, among the various Linux distros. FWIW, OS X also uses sudo in a similar way to Raspbian and the *buntus (although it's a BSD derivative rather than Linux).

plugwash
Forum Moderator
Forum Moderator
Posts: 3454
Joined: Wed Dec 28, 2011 11:45 pm

Re: What is the root password for wheezy?

Thu May 02, 2013 1:48 pm

jojopi wrote:Even if having no root password is not the default in Debian (which is debatable) it is certainly a fully supported option.
Indeed debian added support for the ubuntu style setup some time ago, I don't remember exactly when.

Taking a look it seems the situation is a bit messy. The installer has a question asking which setup you want which defaults to the traditional setup BUT that question is not shown in a normal install. Instead they made the installer automatically switch to the "ubuntu style" setting if the user gives an empty response to the request for a root password. So if you give an empty/default response for every question that doesn't force you to do otherwise you will get a ubuntu style install.

This also makes it fun if you accidently give a blank answer to the root password prompt, you can't just go back and enter one, you have to back out to the menu, change the debconf priority so the question of which style of password setup you want becomes visible and THEN you can set a root password.
pluggy wrote:It isn't locked out, it just doesn't have a password, so by default you can't login as root.
I guess it depends on your definitions of "locked out" and "doesn't have a password"

There are various possible states for the password field in /etc/shadow

If it's set to a password hash then you can login with the corresponding password
If it's set to * then you can't log into the account with password authentication (though other means of getting into the account may still be possible), this is the state I was reffering to when I said "locked out".
If the field is empty then you can login without a password (at the local console anyway, ssh doesn't allow login to such accounts by default).

Maybe it would be more accurate to say the "password is locked out".
Easiest thing in the world to give root a password so you can login with it. Of course if I told you how to do it they'd be calling for my execution on here......
What makes you think that?

FYI to set the root password you use the command "passwd root" of course to do that you need to be root ;). If you have access to an account with unrestricted sudo you can do "sudo passwd root".

If you don't have access to an account with unrestricted sudo access but do have access to edit the kernel command line (on the Pi this can be achived by putting the SD card in a PC, on many PC based linux installs this can be done through the bootloader menu) then you can add "init=/bin/sh" to the kernel command line. Then boot the pi and do "mount -o remount,rw /" followed by "passwd root" followed by "exec init".

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: What is the root password for wheezy?

Thu May 02, 2013 2:41 pm

I've never had to do the "mount -o remount" thing. I think it is writable by default. That's always been my experience anyway.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

plugwash
Forum Moderator
Forum Moderator
Posts: 3454
Joined: Wed Dec 28, 2011 11:45 pm

Re: What is the root password for wheezy?

Thu May 02, 2013 3:04 pm

Some filesystems can't be properly checked if they are mounted read/write so debian at least sets things up to mount read only by default and then remount read/write after the disk check. Not sure if the raspberry pi foundation bother with that though so it may be unnessacery with their raspbian images.

Return to “General discussion”