maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Newbie (https://talk.maemo.org/forumdisplay.php?f=26)
-   -   Help needed.. (https://talk.maemo.org/showthread.php?t=67984)

SavageBrat 2011-01-07 00:20

Help needed..
 
I had forgotten my ssh client/server password for winscp, so i un-installed ssh and installed it and re-installed it, but still didn't work so instead of changing it in the terminal..i was in filebox so i deleted my password file figuring I'd just install ssh with a new password and be done,well i re-booted my phone and it's now stuck on the blue nokia screen.. do i need to re-flash the whole thing.. help... :(

jd4200 2011-01-07 00:33

Re: Help needed..
 
Which password file did you delete? Hopefully it wasn't /etc/passwd.

I think you will need to reflash (not the emmc though).
In future you can change the password by typing:
passwd user

SavageBrat 2011-01-07 00:40

Re: Help needed..
 
yep thats the one...

jd4200 2011-01-07 00:52

Re: Help needed..
 
Quote:

Originally Posted by SavageBrat (Post 913796)
yep thats the one...

Oh, bugger.
That's an important system file that stores information on all the accounts on the system, so no services or no person will be able to start or login.

You're going to have no choice but to re-flash unfortunately. :(

As a rule of thumb in future, don't delete anything out of the /etc/ directory, or even better anything that is 'root' owned.

Mentalist Traceur 2011-01-07 00:59

Re: Help needed..
 
Keep in mind that "passwd [username]" only works on the "root" username so long as you're root yourself, as far as I know.

And I am pretty sure the SSH password is a separate file, so I don't think it would've solved his problem, either... *Shrug*

Edit: But yeah, that basically covers what the /etc/passwd file does. No disagreements there.

jd4200 2011-01-07 01:09

Re: Help needed..
 
Quote:

Originally Posted by Mentalist Traceur (Post 913802)
Keep in mind that "passwd [username]" only works on the "root" username so long as you're root yourself, as far as I know.

And I am pretty sure the SSH password is a separate file, so I don't think it would've solved his problem, either... *Shrug*

Executing 'passwd user' (or just passwd) would prompt you for a new password for the account specified (or if none given, the current logged in user), and the account password is the password you use to login via SSH. Well as far as I'm aware :)

[Edit]:
Is there any way to mount the root filesystem via USB?
I suppose that way a new passwd file may be copied over.

Mentalist Traceur 2011-01-07 06:37

Re: Help needed..
 
I just tested (Because I have no idea what my user password was on the N900... *Shrug*). sudo gainroot, then passwd user. And yes, you're right, it IS the same password you use to log in through SSH. Made me rather happy to find that out.

However, I also noticed it wasn't letting me run "passwd user" as user. It basically told me I wasn't allowed to change that password. (Worked fine as root though.)

As for mounting from USB... Not sure. I do know that you can use the flasher to merely load a kernel into memory instead of reflashing. And you can use the rescue kernel on the MeeGo project site (don't ask me how, I don't know, I never had to), to boot into some form of shell from which to recover the device...

Multiboot and BackupMenu both have the ability to drop you into a shell early in the load process. BackupMenu is pretty versatile/powerful, as far as that goes. You can definitely mount rootfs from within it, get SSH access from the 'outside', and scp your requisite files, or unpack a backup'd one. Problem is, if you don't have them installed before you bootloop/bootstuck, you can't really get it back on the device without some extra hacking. I suppose if Flasher was open source, or something similar existed, one could create a kernel image that drops you into the backupmenu shell. Then just either flash, or do the non-flashing load-into-RAM-and-boot-with-it method... But I don't know of any such images.

The user friendly best bet is just reflash and be done with it, I'd say. The harder method is find that rescue kernel I mentioned, and boot into that using Flasher, and hope you can get enough filesystem access and a passwd file that's close enough to what you had to fix your system. The only thing is, I don't think /etc/passwd counts as part of the kernel, so a flashed/loaded kernel will still presumably try to read that passwd file - unless, again, the drop-into-shell comes first.

...I suppose if uboot got more popular, a BackupMenu port, or a similar script, could be ran from within uboot, which CAN be flashed/loaded in as part of a kernel image, and will load/run before the actual kernel stuff and beyond happens.


All times are GMT. The time now is 03:05.

vBulletin® Version 3.8.8