Own goal... can I recover from a silly mistake?

Good news is that me self hosted EmonCMS 8.3.6 server is running and all is good.

I was trying to setup a working FTP client so I can upload some custom javascript charting content based on d3 (pretty cool stuff by the way).

Anyway- following this tutorial (http://www.instructables.com/id/Raspberry-Pi-Web-Server/step9/Install-an...) I screwed up.  I changed the pi user in file /etc/passwd as described, after setting the root password as described.

I realized I'd messed up by not logging on as root (which of course cannot log on with user root) before changing the /etc/passwd file.

sudo no longer works with user pi... and I can't log on with user root.  Now that I've timed out and disconnect my session I can no longer login with pi.  So basically - I've lost my admin rights on my pi.

Does anyone have any thoughts on another user I can regain admin access to my pi on a standard EmonCMS build?

If I boot my pi and connect with a keyboard and monitor can I use the root user?

In a bit of a pickle....

Bill Thomson's picture

Re: Own goal... can I recover from a silly mistake?

If you can get logged on to the root account - with a local keyboard/monitor - then yes, you'll be able to edit the passwd file to remove the # character. If you can't log on locally, then an alternate solution would be to mount the card as a second volume on your Pi while booted from another SD card. Mounting the card on another Linux box would be yet another choice.

Regards,

Bill

Keen2bGreen's picture

Re: Own goal... can I recover from a silly mistake?

Bill - you're a star!  Thanks for that encouragement to fish out a USB keyboard and hook up a monitor.  All sorted now.

Let's see what I can mess up next!

Cheers

Mike

Bill Thomson's picture

Re: Own goal... can I recover from a silly mistake?

You're very welcome, sir! Good to hear you got it going again.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.