Raspbian, what is root password?


32 posts   Page 1 of 2   1, 2
by trn » Mon Oct 22, 2012 8:08 pm
Hi,

i want root password for raspbian.
What is root password?
Or how i set my root pass.
Posts: 46
Joined: Wed May 09, 2012 11:30 am
by hexelpdkk » Mon Oct 22, 2012 8:10 pm
User avatar
Posts: 128
Joined: Fri Feb 24, 2012 4:40 pm
by trn » Mon Oct 22, 2012 8:31 pm
and what is revert sudo passwd root?

There is no root password set by default on Debian. You are expected to do everything through sudo. You can set one with "sudo passwd root" - just make sure you know what you are doing with a root account.
Posts: 46
Joined: Wed May 09, 2012 11:30 am
by AndrewdAzotus » Wed Feb 06, 2013 3:09 pm
so does all this mean that no one can login as root until and unless the root password is set from the pi account?

(I do not want to log in as root, I just want to ensure that no one else can either...)
Posts: 59
Joined: Wed Feb 06, 2013 3:07 pm
by jojopi » Wed Feb 06, 2013 5:33 pm
AndrewdAzotus wrote:so does all this mean that no one can login as root until and unless the root password is set from the pi account?
Yes. And that, in my opinion at least, is why this is the best policy. It means there is one less default password to change. Those who want a root password would have had to change it from the default anyway.
User avatar
Posts: 2103
Joined: Tue Oct 11, 2011 8:38 pm
by tonyhughes » Wed Feb 06, 2013 6:45 pm
To add my 2c worth:

Above replies are all valid.
No need to enable root account.
'sudo <command>' is a great way of doing things.
'sudo su' will give you a full root shell until you:
'exit', without needing a root password enabled.
If you create a new user account for yourself, consider deleting the Pi account.
Don't forget to give yourself sudo rights.
Baked Linux Mod http://www.geek101.co.nz/bakedlinuxmod

Easy install of Drupal, Wordpress, RazorCMS, Chyrp, Apache, Nginx, Lighttpd, firewall, Webmin, VNC, RDP, FTP servers, mailservers, MySQL, SQLite, Transmission and more...

tall.co.nz/webcam.jpg
User avatar
Posts: 931
Joined: Wed Dec 26, 2012 3:46 am
by Jide » Sun Jul 07, 2013 6:02 pm
That does not help me. I have just installed Dyalog APL and, while rebooting, the pi user is not recognized anymore. Only root seems to be recognized, but I do not have its password (which should exist)...
Posts: 1
Joined: Sun Jul 07, 2013 5:59 pm
by a2life » Mon Jul 08, 2013 10:36 pm
checking the online manual of APL, this is what they say to access root
To install Dyalog APL on the Raspberry Pi:
1. Open a terminal window and log in as the root user – change to the root
user with the following command:
$ sudo su
2. ....


so, "sudo su" is the right way to access the root and you can use your pi account.
Posts: 1
Joined: Mon Jul 08, 2013 10:10 pm
by Dutch_Master » Wed Jul 31, 2013 2:00 am
Apols for the late reaction, just joined the RPi forums recently.
tonyhughes wrote:No need to enable root account.
'sudo <command>' is a great way of doing things.

Sorry, but I have to disagree here. Sudo is a solution to a problem that never existed. There's nothing sudo can do what you couldn't do with the existing Unix/Linux permission system (user, groups, etc) and tools. What's the difference between
Code: Select all
su <enter, enter root password>
rm -f *.* /
and
Code: Select all
sudo rm -f ./*.* <enter, enter password>

There is none... In both cases the shell will delete all files from the filesystem. Sudo does not prevent against user stupidity/ignorance/lack-of-attention*, but it does add (significantly) more key strokes to each command.

*encircle as appropriate :P

Consider this:
Code: Select all
make && make modules && make modules_install && make install && mkinitramfs -o /boot/initrd.img-2.6.38 2.6.38

(this actually builds and installs a 2.6.38 kernel from source, but some important initial steps are preceding it, not discussed further)

Now the same line, with sudo:
Code: Select all
sudo make && sudo make modules && sudo make modules_install && sudo make install && sudo mkinitramfs -o /boot/initrd.img-2.6.38 2.6.38

That's 5 sudo's, so 5 times entering your password... And until you do, it will not proceed to the next step, meaning you can't leave it unattended or overnight to run. :roll:

To cut a long story short, the conclusion has to be that vanilla Raspbian is not for power users. :(

PS: Debian most certainly has a root password by default, Raspbian is the only Debian (that I know of) that uses sudo by default, like Ubuntu does. Unless I missed something in the last decade of using Debian... (hey, I'm only human!)
Mind that Debian based distro's, like Ubuntu and Mint, are not Debian by definition. :!:
Posts: 278
Joined: Sat Jul 27, 2013 11:36 am
by malakai » Wed Jul 31, 2013 2:22 am
To cut a long story short, the conclusion has to be that vanilla Raspbian is not for power users. :(



Most children are born Linux Power Users these days aren't they? :lol:
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
by plugwash » Wed Jul 31, 2013 2:43 am
Dutch_Master wrote:Sorry, but I have to disagree here. Sudo is a solution to a problem that never existed. There's nothing sudo can do what you couldn't do with the existing Unix/Linux permission system (user, groups, etc) and tools. What's the difference between
Code: Select all
su <enter, enter root password>
rm -f *.* /
and
Code: Select all
sudo rm -f ./*.* <enter, enter password>

There is none...

There is a little less (but not much less really) temptation to leave a shell running as root and execute all commands as root not just the ones that actually need root.

But overall I agree, I don't much like "ubuntu style" sudo. It might be useful in cases where you have multiple sysadmins and don't want to have a shared root password but I'm not at all convinced that is a common case.

Note that "ubuntu style sudo" was not really sudo's original use. Afaict it's original use was to allow a user run a handful of commands as root without giving them overall root powers.

That's 5 sudo's, so 5 times entering your password... And until you do, it will not proceed to the next step, meaning you can't leave it unattended or overnight to run. :roll:

That depends on how sudo is configured. You don't have to have sudo prompt you for a password if you don't want it to (whether it's a good idea to have it not do it is of course debatable).

BTW many would consider it bad practice to run the actual compile as root regardless of whether you are using su or sudo (though many do anyway out of laziness)

To cut a long story short, the conclusion has to be that vanilla Raspbian is not for power users. :(

meh, if you want a root password and the image you are using (see below) doesn't have one set thne set one, it's not rocket surgery.

PS: Debian most certainly has a root password by default, Raspbian is the only Debian (that I know of) that uses sudo by default, like Ubuntu does. Unless I missed something in the last decade of using Debian... (hey, I'm only human!)
Mind that Debian based distro's, like Ubuntu and Mint, are not Debian by definition. :!:

This is where things get somewhat messy.

A freshly debootstraped debian or raspbian rootfs has the root account locked out, it also doesn't have sudo installed or configured. So if you want a system that you can actually log into after booting it then something or someone has to do some user setup after running debootstrap. How the users are set up will depend on the behaviour of that someone or something.

The debian installer asks the user for a root password. If one is given it sets up things in the traditional way, if one is not given it sets up "ubuntu style sudo". I strongly suspect that the hacked up version of the debian installer someone made available for installing raspbian (which isn't very well supported) does the same.

The raspberry pi foundation images of debian and raspbian come with the root password locked, the password for the pi user set to raspberry and sudo wide open for the Pi user (setup to not even give a password prompt) by default.

The minimal images I have built and released come with the root account setup with no password and not locked out by default (that is you type root at the login prompt and it logs you in without prompting for a password).

Images produced by other people may have other setups.
Forum Moderator
Forum Moderator
Posts: 2285
Joined: Wed Dec 28, 2011 11:45 pm
by Dutch_Master » Wed Jul 31, 2013 2:51 am
Thanks for explaining that, much appreciated!

As I'm just beginning with the RPi I'll investigate the device with Raspbian first. But at one time I think I'll be making the switch to a full Debian. Or another distro or even OS ;) (RiscOS anyone? :P ) We'll see. First I have to get some gear to get my Pi working, that'll be tomorrow.
Posts: 278
Joined: Sat Jul 27, 2013 11:36 am
by rpdom » Wed Jul 31, 2013 4:04 am
Dutch_Master wrote:Thanks for explaining that, much appreciated!

As I'm just beginning with the RPi I'll investigate the device with Raspbian first. But at one time I think I'll be making the switch to a full Debian


Why switch? Raspbian is as close to Debian as you can get, you just might want to customise a few bits to be the way you want them. On my main Pi I've set a root password and created a normal user (the same setup as my Debian boxes), and got rid of the pi user. On my other Pi systems I've left it as it was.

Besides, Debian doesn't support hardware floating point on the Pi and runs a lot slower than Raspbian on many programs.
Posts: 3597
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by Dutch_Master » Thu Aug 01, 2013 2:13 am
Fair point. I've successfully booted the first RPi today, but lacked the time to investigate further. I'm awaiting the arrival of some touchscreen add-on boards now. But that wasn't the purpose of this thread, so... ;)
Posts: 278
Joined: Sat Jul 27, 2013 11:36 am
by WacoJohn » Tue Aug 13, 2013 11:21 pm
If there is no default root password, what is a rookie to do when Aptitude requires one in order to install a package??? (repeat, ... rookie).
Posts: 73
Joined: Wed May 15, 2013 9:30 pm
Location: Waco, TX USA
by Dutch_Master » Sun Aug 18, 2013 12:36 am
Just realised your question wasn't answered yet: well, it depends on how the system is set up. If a root password is necessary, a user cannot invoke aptitude from the cli on his own account, he will simply be rejected. If the system is configured to use sudo, the kernel will ask for the users password and check the action is allowed from the sudoers file. If successful, aptitude will run with root powers (and so be able to install packages).
Posts: 278
Joined: Sat Jul 27, 2013 11:36 am
by WacoJohn » Tue Aug 20, 2013 4:17 am
Well, thank you Sir for the reply. Evidently, I am 'set up' for it to ask, and I don't know what it is, so I installed Synaptics Pkg Mgr. Seems like a lot of storage space just for the fact I don't know the root p/w.

Can you maybe explain how to 'set it up' ... or something so I can use Aptitude to install pkgs? Or best for me to stay with Synaptics (Rookie here)?

Thank you in advance.
Posts: 73
Joined: Wed May 15, 2013 9:30 pm
Location: Waco, TX USA
by rpdom » Tue Aug 20, 2013 4:25 am
Well, the usual method would be to use aptitude (or apt-get) from the command line with sudo.

[edit]The default is for the "pi" user to have permissions to do that.
Posts: 3597
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by WacoJohn » Tue Aug 20, 2013 12:59 pm
apt-get ....yes .... that is a nice and lean way to go. Thank you again.
Posts: 73
Joined: Wed May 15, 2013 9:30 pm
Location: Waco, TX USA
by rwi » Sun Sep 22, 2013 10:04 am
Maybe just type "sudo passwd root" and set root password by Yourself ?? ;)
Posts: 1
Joined: Sun Sep 22, 2013 10:00 am
by WacoJohn » Sun Sep 22, 2013 1:15 pm
I am more confused than ever ... and have a headache :roll:

From a rookie's standpoint, .. a Raspberry Pi has limited storage .. 4GB in my case. Seems that to do the simplest things, one ends up installing MBs of programs, dependencies and space gobbling 'stuff'. Mine did not come with Synaptics ... it came with Aptitude which I had never even seen before (Ubuntu rookie too). Sooo, in order to install something (don't recall what it was), I gave Aptitude a try. Instant defeat .. password? Don't have one that I know of. Documentation? HAH ... nonexistant for me.

Made the storage sacrifice and installed Synaptics and have not been back to Aptitude since. I would like to learn to use Aptitude .. so I can be a 'Nix head too ... but that is not likely.

So, I go to Google and do a search and find this thread ..... and get a headache. Best I can figure, Aptitude is on my system, but I can't use it. Brilliant.

Did I provide Raspbian with a password when I first booted it? I really don't recall. If I did, I ALSO don't recall what it was. How do I find out?????

Hmmmm pi/raspbian .... that sounds familiar. I think the user account is pi and its password is raspbian(?) So what does that have to do with Aptitude???

Root ... uh huh, ..... sudo .. uh .... yeah, ... su ... whut?

Anyway ... my point is .... I have a headache.
Posts: 73
Joined: Wed May 15, 2013 9:30 pm
Location: Waco, TX USA
by AndrewS » Sun Sep 22, 2013 3:31 pm
Simply run
Code: Select all
sudo aptitude
or
Code: Select all
sudo aptitude install some-package

It'll ask you for a password, which is the password for your 'pi' user account. If you haven't changed the password yourself, the default password can be found on http://www.raspberrypi.org/downloads
(for people using Raspbian, the password for the 'pi' user is 'raspberry')
User avatar
Posts: 3626
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by rpdom » Sun Sep 22, 2013 3:39 pm
It shouldn't ask for a password at all. The pi user has been set up to use sudo for any command without a password (on Raspbian, at least).
Posts: 3597
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK
by AndrewS » Sun Sep 22, 2013 4:02 pm
Doh, my mistake :oops: I use so many different distros I get confused sometimes!
User avatar
Posts: 3626
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by WacoJohn » Sun Sep 22, 2013 5:00 pm
AndrewS wrote:Doh, my mistake :oops: I use so many different distros I get confused sometimes!


Actually,
I am VERY grateful for any knowledge so thank you AND OTHERS.

So ... run Aptitude from terminal IF asks for p/w, the default is password. I think I 'got it'.

It shouldn't ask for a password at all. The pi user has been set up to use sudo for any command without a password (on Raspbian, at least).


Does that mean run:

Code: Select all
    sudo aptitude
or
    sudo aptitude install some-package
or
   aptitude (sudo not needed)
or
     aptitude install some-package (sudo not needed)


THEN, if I run Aptitude Package Manager (text) (which came with the pi) from GUI (not CLI), type u (UPDATE) it asks if I want to become root, and then asks for ROOT PASSWORD. I enter pi account p/w and it fails to authenticate (yes, I am sure (now) of that p/w).

So, it seems this pkg requires a root p/w and apparently .. there isn't one(?)

I am trying to learn to use the tools available instead of installing "easier" tools and gobbling space. This is more of an academic issue than a practical one.
Posts: 73
Joined: Wed May 15, 2013 9:30 pm
Location: Waco, TX USA