User avatar
D.E.L.B.
Posts: 92
Joined: Sat Jun 09, 2012 7:16 pm
Location: Wales, UK
Contact: Website

Changing root name on Pi

Wed Jun 13, 2012 12:03 am

Hey,

How would you go abouts changing the root name that is on the Raspberry Pi? I wouldn't mind chnging the root name to my initials to make my Raspberry Pi like it's my own PC.

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Changing root name on Pi

Wed Jun 13, 2012 12:16 am

This idea goes against the user/permissions structure that all unix like systems follow. Unless it is required by the situation (for example installing a package) you should never use the root account. You should pop in and perform the given taken and then pop back out using the command

Code: Select all

sudo <command>
This allows you to have momentary root access. If you feel that your main user account needs permissions to perform specific tasks (configure network settings, access power management tuning parameters, etc) then you should add your main account to the appropriate group to give yourself access.

To setup sudo install it

Code: Select all

apt-get install sudo # Debian
pacman -S sudo # Arch
Next as root edit the sudo configuration:

Code: Select all

visudo
You will be editing the configuration file for which users and groups get access to sudo. Find the line that looks like the following and make sure its uncommented.

Code: Select all

%wheel ALL=(ALL) ALL
Any user account you create that is part of the group wheel will be able to execute sudo commands.

To add an existing user type the following as root (replace joe with your username):

Code: Select all

gpasswd -a joe wheel
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

User avatar
D.E.L.B.
Posts: 92
Joined: Sat Jun 09, 2012 7:16 pm
Location: Wales, UK
Contact: Website

Re: Changing root name on Pi

Wed Jun 13, 2012 12:34 am

Thanks for speedy reply.

I am quite inquisitive, so I was wonder what does "-s" mean, and what does wheel do?

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Changing root name on Pi

Wed Jun 13, 2012 12:50 am

Wheel is the name of the group that gives users the privilage of "gaining super user privilage". The name has historical meaning from back in the TENEX/TOPS days.

The -S flag (I assume you mean in the arch linux package installer "pacman") tells pacman to install the package stated via the internet, or "Synced" from the repository. If you are talking about a different -s flag...please explain where you saw it.
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

User avatar
D.E.L.B.
Posts: 92
Joined: Sat Jun 09, 2012 7:16 pm
Location: Wales, UK
Contact: Website

Re: Changing root name on Pi

Wed Jun 13, 2012 12:55 am

I use Debian Squeeze, so I would use apt-get to download the package file from the Internet.

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Changing root name on Pi

Wed Jun 13, 2012 12:56 am

You are correct sir.
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

User avatar
D.E.L.B.
Posts: 92
Joined: Sat Jun 09, 2012 7:16 pm
Location: Wales, UK
Contact: Website

Re: Changing root name on Pi

Wed Jun 13, 2012 12:58 am

These same steps will also work on Debian Squeeze, the same way they work on Arch Linux too?

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Changing root name on Pi

Wed Jun 13, 2012 1:05 am

Yep they should. The only difference between most distros is the package manager. Both Debian and Arch will use the same source code for sudo. Thats the great thing about Linux.
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

User avatar
D.E.L.B.
Posts: 92
Joined: Sat Jun 09, 2012 7:16 pm
Location: Wales, UK
Contact: Website

Re: Changing root name on Pi

Wed Jun 13, 2012 1:06 am

Thanks for the quick and intuitive replies!

Linux is a great system for people who love computers down to the core of them.

User avatar
D.E.L.B.
Posts: 92
Joined: Sat Jun 09, 2012 7:16 pm
Location: Wales, UK
Contact: Website

Re: Changing root name on Pi

Wed Jun 13, 2012 2:53 am

I've ran into a problem.

There is no wheel in Debian Squeeze, there is a Sudo, Admin and User account there, but I am unable to add my initials account to the Sudo group because it does not allow me to, any advice?

The problem I'm running into is that when I launch the XLDE I try to launch up Synaptic and it asks me for a password, I enter my password that I am logged onto and it does not accept it, I've tried resetting the password with the passwd command but that didn't make a difference.

Any advice, please?

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Changing root name on Pi

Wed Jun 13, 2012 3:00 am

There is a sudo group? Sorry I haven't run Debian in a few years. You could add your user to that group or you could create a wheel group

Code: Select all

groupadd wheel
and then do the rest of the steps I stated before. The actual group name is not really important, its just everyone will know what the wheel group is if you ask questions about it.
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

User avatar
D.E.L.B.
Posts: 92
Joined: Sat Jun 09, 2012 7:16 pm
Location: Wales, UK
Contact: Website

Re: Changing root name on Pi

Wed Jun 13, 2012 3:06 am

Okay, but how do you give the group "wheel" sudo permissions?

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Changing root name on Pi

Wed Jun 13, 2012 3:21 am

D.E.L.B. wrote:Okay, but how do you give the group "wheel" sudo permissions?
That is performed by editing the sudoers fileby running visudo. The line i stated above says the group wheel (%wheel) has access to all subsystems. If you really want to understand the structure run man sudoers but its dry and not important at this point.
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

User avatar
D.E.L.B.
Posts: 92
Joined: Sat Jun 09, 2012 7:16 pm
Location: Wales, UK
Contact: Website

Re: Changing root name on Pi

Wed Jun 13, 2012 3:24 am

Ah so the percent in-front of it makes it access everything?

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Changing root name on Pi

Wed Jun 13, 2012 3:29 am

No the percent sign states that its a group.

Here is an excerpt from man sudoers
The User specification is the part that actually determines who may run
what.

root ALL = (ALL) ALL
%wheel ALL = (ALL) ALL

We let root and any user in group wheel run any command on any host as
any user.

FULLTIMERS ALL = NOPASSWD: ALL

Full time sysadmins (millert, mikef, and dowdy) may run any command on
any host without authenticating themselves.

PARTTIMERS ALL = ALL

Part time sysadmins (bostley, jwfox, and crawl) may run any command on
any host but they must authenticate themselves first (since the entry
lacks the NOPASSWD tag).
WARNING MORE ADVANCED TOPICS: The FULLTIMERS and PARTTIMERS are not "Groups" but alias in the sudoers file. For this conversation pretend they are groups (%fulltimers and %parttimers)
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Changing root name on Pi

Wed Jun 13, 2012 8:38 am

The correct method to add a new user is described in the Wiki.
http://elinux.org/RPi_Beginners#Create_ ... privileges

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Changing root name on Pi

Wed Jun 13, 2012 9:49 am

D.E.L.B. wrote:The problem I'm running into is that when I launch the XLDE I try to launch up Synaptic and it asks me for a password, I enter my password that I am logged onto and it does not accept it, I've tried resetting the password with the passwd command but that didn't make a difference.
http://elinux.org/R-Pi_Troubleshooting# ... y_password :)

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Changing root name on Pi

Wed Jun 13, 2012 3:24 pm

bredman wrote:The correct method to add a new user is described in the Wiki.
http://elinux.org/RPi_Beginners#Create_ ... privileges
Good find, crazy Debian with their sudo group rather than being like everyone else :twisted:
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

User avatar
D.E.L.B.
Posts: 92
Joined: Sat Jun 09, 2012 7:16 pm
Location: Wales, UK
Contact: Website

Re: Changing root name on Pi

Wed Jun 13, 2012 10:47 pm

Thanks for everyone's help.

Though I would like to ask a question on what the --gconftool command does, and what the "type --bool" command does. If I may.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Changing root name on Pi

Thu Jun 14, 2012 8:25 am

To answer step-by-step

gconftool-2
This is a program to configure the Gnome Display Manager

--type bool
You are trying to change a Boolean variable

--set
You are trying to set the variable

/apps/gksu/sudo-mode
This is the variable name

true
This is the variable value

The actual result is that GDM should use sudo for authentication instead of the default su.

sudo requests the user's own password, while su requests the root password.

User avatar
D.E.L.B.
Posts: 92
Joined: Sat Jun 09, 2012 7:16 pm
Location: Wales, UK
Contact: Website

Re: Changing root name on Pi

Thu Jun 14, 2012 5:05 pm

Thank you for all of your replies, they have been extremely helpful!

Since its asking for my password now to access it, and if I enter my password, which now does work. How can I stop this from happening?

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Changing root name on Pi

Fri Jun 15, 2012 5:13 am

D.E.L.B. wrote:Thank you for all of your replies, they have been extremely helpful!

Since its asking for my password now to access it, and if I enter my password, which now does work. How can I stop this from happening?
I assume you are asking how to sudo without a password you can do something like this:

Code: Select all

%wheel ALL=(ALL) NOPASSWD: ALL
If you meant something else...im sure there's a way to do it, whatever it is you are asking.
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Changing root name on Pi

Fri Jun 15, 2012 8:00 am

D.E.L.B. wrote:Since its asking for my password now to access it, and if I enter my password, which now does work. How can I stop this from happening?
It is very unclear what your are asking. It sound like you got it fixed and now you don't want it fixed.

What is happening that you want not to happen?

User avatar
D.E.L.B.
Posts: 92
Joined: Sat Jun 09, 2012 7:16 pm
Location: Wales, UK
Contact: Website

Re: Changing root name on Pi

Fri Jun 15, 2012 3:46 pm

Yes sorry it wasn't unclear. Had to rush out.

Well it asks for the password still, and when I enter the password this time it still asks me for it, I don't want that box that comes up to come up, I mean I know it sounds weird but when I use the "startx" command on the CLI, I want it to launch with the desktop, and if I want to use Synaptic I don't want the box to enter my password to come up :).

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Changing root name on Pi

Fri Jun 15, 2012 3:56 pm

Look at it as a "security warning/reminder" that the program you're about to run could screw up your system if you're not careful ;)

Return to “Beginners”