Log in as root, raspi.

Associate
Joined
8 Feb 2012
Posts
500
Location
London
Hello.

I'm doing a little project at the moment with raspberry Pis.
I had to setup and auto login from boot and start a bash script once it logs in.
Luckily the guide below showed me exactly how to.
http://www.opentechguides.com/how-to/article/raspberry-pi/5/raspberry-pi-auto-start.html

However the problem I have is that I want to now login as root instead of pi. I know its highly recommended not to but I need to as root for the rights for the bash script.
Does anyone have an idea on how I can do this?

Thank you.
 
Replace "pi" in inittab with "root"?

Although you really shouldn't be logging in as root and instead have another script that runs the bash script from user account with sudo. Or change ownership of the script.
 
The big question is what are you trying to do in the script and hence why does it need to be run as root?

As OhEsEcks says if you just have a couple of things in the script which require root access then you may be able to do something with sudo
 
Replace "pi" in inittab with "root"?

I tried that before and that didn't work, it just goes back to Pi once I reboot. It doesn't save it to root.

Although you really shouldn't be logging in as root and instead have another script that runs the bash script from user account with sudo. Or change ownership of the script
Yeah I'll try that, thank you.
 
Back
Top Bottom