Welcome! Log In Create A New Profile

Advanced

Locked out of SSH

Posted by Krymium 
Krymium
Locked out of SSH
September 21, 2012 01:42AM
I have a PogoPlug series 4 running stock firmware. I was attempting to install Optware and inadvertently screwed up the /etc/passwd file so cannot login to SSH any more for the root account. I dont have any other user accounts on the device. My.pogoplug.com continues to work fine - I am wondering if there is anyway I can boot of SATA or USB and revert the passwd file on the device?
Re: Locked out of SSH
October 01, 2012 07:48AM
I don't know Optware, so maybe I miss the real problem.

Concerning your /etc/passwd:

~ # grep root /etc/passwd
root:x:0:0:root:/root:/bin/bash

I think you have the same.

I assume you have /etc/shadow - this is the place where the passwords are stored, encrypted and saltet. A line consists of information separted by colons (":"). First is the uid ("root" in this case), a colon, the encrypted password, a colon, more information, etc. Make a backup of the file and make the line of root starting like this by erasing the encrypted password between the colons:

root::...

"..." represents the rest of the line, unaltered.

By doing this, you set an empty password for root.

Another idea: cd to the mounted filesystem and chroot there. Google a bit on how to set environment correctly then call passwd to set a new passwd for root.

There are no silly questions
Re: Locked out of SSH
October 01, 2012 10:49AM
In this case, that wont work because it is on the NAND.
Krymium
Re: Locked out of SSH
October 01, 2012 11:55PM
Problem is I dont have access to run anything on the pogoplug right now. My SSH login fails since it cannot spawn a shell.

killerhippy Wrote:
-------------------------------------------------------
> I don't know Optware, so maybe I miss the real
> problem.
>
> Concerning your /etc/passwd:
>
> ~ # grep root /etc/passwd
> root:x:0:0:root:/root:/bin/bash
>
> I think you have the same.
>
> I assume you have /etc/shadow - this is the place
> where the passwords are stored, encrypted and
> saltet. A line consists of information separted by
> colons (":"). First is the uid ("root" in this
> case), a colon, the encrypted password, a colon,
> more information, etc. Make a backup of the file
> and make the line of root starting like this by
> erasing the encrypted password between the
> colons:
>
> root::...
>
> "..." represents the rest of the line, unaltered.
>
> By doing this, you set an empty password for
> root.
>
> Another idea: cd to the mounted filesystem and
> chroot there. Google a bit on how to set
> environment correctly then call passwd to set a
> new passwd for root.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: