5

I'm using BerryBoot as my bootloader and newest Raspbian as my OS. In order to make things more secure, I've created new root user using this tutorial: LINK and then I changed my auto login username with this thread's help: Another LINK.

When I rebooted all seemed to work just fine, I was logged as my new user. In the end, I wanted to get rid of pi user once for all so I ran sudo deluser -remove-home pi command. It deleted the user but returned error (8 if I recall correctly) so I've checked running processes and I saw few processes running on Pi, even if it seemed that I am logged on new user on each reboot.

So I rebooted the Pi once more and after BerryBoot all I saw was a black screen. Something went wrong and I think and I am not sure at which point. Any solutions?

9
  • 1
    Do you have a command line? If so what happens if you type startx? check the home directory for a file called .xsession-errors.old (note the leading . which indicates a hidden file to view it type ls -la). For future reference you would have been better off disabling pi logins until you are sure everything still works. Did you make the new user a member of all the groups that Pi was. did you make edits to the /etc/sudoers file to give the new user sudo privileges? Dec 16, 2015 at 22:21
  • @Steve I used sudo useradd -m somename -G sudo command to create new user and I also changed autologin in rapi-config using nano, and I also changed it in /etc/rc.local . As I mentioned in OP the new user, his sudo privilages and autologin worked just fine, but somehow PI user was also being logged in. I'm guessing that I missed autologin somewhere else so both newaccount and Pi were being logged in after OS startup, which might caused OS failure after deleting Pi.
    – Radziu
    Dec 16, 2015 at 22:30
  • 1
    It may not be what you want to hear, but it maybe easier to reflash the SD Card and start from scratch - consider it paying your dues for learning Linux system administration. Dec 16, 2015 at 22:31
  • The pi user may not be logged in but it may be the owner of a start up script or the owner who runs a process. You can disable the pi user, but the system seems unstable and the type of thing you could be chasing down for months as strange things creep up. Dec 16, 2015 at 22:33
  • @SteveRobillard well. I am okay with reflashing OS, but I want to make my PI secure enough and changing Pi login (by creating new one and deleting old one) seemed fairly easy, but it the end it wasnt, so I'd like to know where I made a mistake.
    – Radziu
    Dec 16, 2015 at 22:33

1 Answer 1

2

As I can't tell what else happened to the system I'd recommend you to first reflash the sdcard. Secondly create new user and add it to sudoer group and then lock the pi user.

passwd pi -l

Then reboot the system. It should work, check the running processes what user they use

ps aux

If everything checks out and no process is running with pi user, then go ahead and delete the user, but leave home directory intact. And then reboot again and lastly remove the home directory of the user. If anything fails along those steps you'll know what step did crash the system and you can investigate more.

1
  • Problems can arise with uid maps if you plan to transfer files to/from the raspberry after changing the pi user (or locking it). Why? By default, the pi user gets uid=1000 (which just happens to be what your uid is if you also set up other Linux boxes you ssh/rsync into the raspberry with). An alternative is to rename the pi account with usermod -l newuser pi (after enabling the root account). You also need to rename /home/pi to /home/newuser and update /etc/passwd with usermod -d /home/newuser newuser after the change. Jan 10, 2017 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.