Balloon Collaboration
December 15, 2019, 01:42:58 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: DaddyB, Larry and Dan are your administrators...Private message for any problems or issues with the Forum//barntekadmin
 
   Home   Help Search gallery Calendar Login Register  
Pages: [1]
  Print  
Author Topic: Changing the Identity of my Pi...  (Read 1421 times)
Larry
Administrator
Hero Member
*****
Posts: 1167



View Profile
« on: December 30, 2012, 12:46:08 AM »

Ok, I have to write this down so I don't lose it.  I am sure I don't have everything here and right, but I will do the best I can.  

I was able to change my pi so it will boot up to the user KI4IMS automatically, all the way to the GUI.  It proved to be a little trickier than I thought and noone on the web seemed to address it directly.  There was a lot of infering on my part.  Basically, my pi now boots up to ki4ims@RPi1.

This is the site i followed to rename the Hostname of the Pi.  It changes the pi@raspberry to pi@RPi1.
  • Type in sudo nano /etc/hostname
  • Change raspberry to whatever you want your new hostname to be. <ctrl>o to save and <ctrl>x to exit.
  • Type in sudo nano /etc/hosts
  • Change anywhere you see 'raspberry' to your new hostname.  <ctrl>o to save and <ctrl>x to exit.
  • Type in sudo reboot
  • This will read in the changes and should boot up with the new hostname

Now, you have to create a new user and give him the same privileges as pi.
  • Type in sudo adduser username where username is the name of the user to create.
  • The system will ask you several questions concerning the new user.  Answer them.
  • Type in sudo visudo
  • Find the line which says root   ALL=(ALL:ALL) ALL and add a line under it identical to it except insert the new username instead of root.  <ctrl>o to save and <ctrl>x to exit.
  • Type in sudo reboot.  When it boots back up, if it boots up to the GUI, then log out and log back in as your new username.  Return to the command line and verify that it shows you logged in as your new username.
    • Type in sudo deluser pi to delete pi as a user, or type sudo deluser -remove-home pi to remove pi as a user and delete the /home/pi directory.
    • Now, type sudo visudo and erase the line you added earlier under root   ALL=(ALL:ALL) ALL.  Then, look at the bottom of the file and find pi ALL=(ALL) NOPASSWD: ALL and change pi to your new username.  <ctrl>o to save and <ctrl>x to exit.

    Now you need to edit the /etc/lightdm/lightdm.conf file to tell it which user to login as when the GUI starts.
    Type sudo nano /etc/lightdm/lightdm.conf and find the line that says autologin-user=pi and change pi to your new username.  Also, find the line that says greeter-hide-users = True and add a # in front of the line.   Be aware that there are 2 lines that say this, and you want to edit the one that has no # in front.  <ctrl>o to save and <ctrl>x to exit.

    Now, if you reboot, it should boot right up to the GUI as your new username and hostname.  Just remember, if this doesn't work, you can always reburn the SD-Card and start over.  Keep in mind, when you do this, anything you had set up under the pi user will be gone and have to be resetup under your new username.  I would suggest trying this with a new burning so if it goes wrong, you won't lose a lot...  hehe

    Good Luck.
« Last Edit: January 07, 2013, 05:42:34 PM by Larry » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!