Root and passwordsit


7 posts
by royb » Wed Jan 09, 2013 5:01 pm
Just started with rasp pi.

I am logging on with 'pi' and 'raspberry'; shutting down with 'sudo' 'halt'.

Am I using a root account by doing this? I understand it's best not to be using a root account for fear of irrevocable damage.

Should I just continue with pi and raspberry log in?

Also, I think I may have created a user account in my name in error. When in some initial confusion I attempted to create an account I've got a message that that name has already been used. Can I see somewhere what accounts exist on my pi and change or delete them if necessary?

Thanks
Posts: 4
Joined: Wed Nov 28, 2012 10:09 pm
by stijn.ghesquiere » Wed Jan 09, 2013 7:34 pm
You're not logged in as 'root' if you login with 'pi'.
If you were, you did not have to put 'sudo' in front of the 'halt' command. Sudo gives you root permission for the command/program you start with it.
How to delete your own user:
Login as pi, and issue 'sudo userdel -r <name>' and that should fix it. But you can also change the password of the user with 'sudo usermod -p <newpassword> <username>'. (when being logged in under 'pi').
If you make a new user, and you want that one to be able to issue 'root' commands, the user should be added to the sudoers group: 'sudo adduser <username> sudo'
With 'cat /etc/passwd' you get the whole list of users of the (and there are a lot of user for all kind of services, not actual 'user' accounts).

I hope that helps you...
Last edited by stijn.ghesquiere on Wed Jan 09, 2013 7:38 pm, edited 1 time in total.
Posts: 15
Joined: Sat May 19, 2012 9:44 pm
by Jim JKla » Wed Jan 09, 2013 7:36 pm
If you are worried you have damaged your code just re-image your SD Card and you are back to square one. ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick
User avatar
Posts: 2040
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK
by royb » Wed Jan 09, 2013 7:42 pm
Many thanks - I'm sure that helps.

Roy
Posts: 4
Joined: Wed Nov 28, 2012 10:09 pm
by Cloudcentric » Wed Jan 09, 2013 8:34 pm
I am presuming form your post you are using Raspbian Distribution on your Pi Computer.

If I want to shut down from command line, having looged in with pi /raspberry I undertake the following pressing enter after each command:

sudo su
shutdown -h now

If I have issued the startx command and working in the Graphical User Environment, I go to Menu, Accessories, Root Terminal and use the above commands.
I know everything about nothing"
Posts: 982
Joined: Fri Sep 14, 2012 9:13 am
by Pete6 » Wed Jan 09, 2013 9:39 pm
Just type
Code: Select all
sudo set passwrd root

whilst logged in as pi and then set the root password to whatever you want. Now you can login as root and suffer the consequences if you mess up. Basically that just means re-doing the SD Card.
My favorite programming language is a soldering iron.
Posts: 29
Joined: Sat Nov 24, 2012 4:02 pm
by Jim JKla » Thu Jan 10, 2013 7:50 am
The RPi gives you the power to royaly screw up and get back to where you started with a re-image.

Just imagine having to reinstall Windows7 just because you set up your child as administrator and the accidentaly wasted the file system.

With the RPi you let them waste the file system ad then show them how to recover it. ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick
User avatar
Posts: 2040
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK