So, this isn’t tough stuff, but any gui-loving user will find themselves in shambles when put in front of a l?[ui]n[iu]x (pardon the regex) terminal. That is to say that it’s OKAY if you’re good “at computers”, yet you can’t fumble your way around a unix-style terminal.
I recently set up my own headless (no GUI) Ubuntu Linux, 8.10 server edition on an old computer I have lying around. I decided that making it run Apache and my personal SVN repositories (while doubling as a 160gb backup drive 🙂 ) was a good idea. Problem is, after I got it all set up, I of course have no decent programs, and suddenly find myself wanting to browse the web on my new server box, to find the appropriate urls to feed to the ‘wget’ command. And I’m tired of pushing my monitor’s “switch input source” button.
By default, Ubuntu tries to abstract the root account from you by letting you perform “root”-ish operations with your own account, using the sudo command. But sometimes I just want to be root for an effing minute while I do stuff. By default, Ubuntu comes with no password on the root account, meaning that it also won’t let you sign in with it directly. Blank passwords are a no-no.
$ sudo passwd root
^^ that ‘$’ is the intrawebs’ way of saying “this is the start of a unix command-line thingy”. And that’s the technical term, trust me.
This is actually the command to change ANY user’s password, but it just so happens that you’re changing the root password, so you of course need the all-powerful pixie dust of the “sudo” command. If you were root already, or some other empowered user, you would only have to type:
$ passwd USERnameGOEShere
And it would prompt you for the new password. But again, if you don’t have good enough authentication, it’ll make you do “sudo” in front of it, or be root altogether.
As pointed out by Dave in the first comment below, the “sudo -s” command is a way to obtain sudo permissions for a more extended period of time. If that’s all you want, then go for it. But if you’re looking to actually give the root account a password, then you’ve gotten your instructions already.