Messed up

Everything that does not fit anywhere else
Post Reply
Nightwolf65
Posts: 7
Joined: Mon Dec 07, 2015 1:04 am

Messed up

Post by Nightwolf65 » Mon Dec 07, 2015 1:15 am

Hi guys, made a stupid error and wondered if there is an easy way out.
I was about to install fun_plug on a d-link dns320l and had an accident. I caught the return key before I'd finished typing a line and now I can't access via root as it says password incorrect. This is as much of the line as I'd typed...
sed -ie 's#:/home/root:#:/ffp
It should have read 'sed -ie 's#:/home/root:#:/ffp/home/root:#g' /etc/passwd'
Is there something I can do to regain root access? I had already created a new root password but it no longer works, I'm hoping this won't mean a hard drive restore as I've a lot of data to backup.
Thanks in advance.

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: Messed up

Post by Mijzelf » Mon Dec 07, 2015 6:55 pm

Your truncated command does nothing. So it's not clear how it can kill your root access.

Nightwolf65
Posts: 7
Joined: Mon Dec 07, 2015 1:04 am

Re: Messed up

Post by Nightwolf65 » Mon Dec 07, 2015 8:01 pm

I can't understand it either. The terminal locked up first then crashed. When I tried to log back in it won't let me.

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: Messed up

Post by Mijzelf » Tue Dec 08, 2015 9:00 am

Well, actually it *does* something, it leaves the sh line editor open.

By executing sed -ie 's#:/home/root:#:/ffp<enter> you actually are inserting a newline in the argument for sed. You will stay in that argument, until you provide the closing quote.

So maybe that 'crashed' your shell? In that case, maybe that shell is still open, in the NAS. Have you tried to reboot it?

Nightwolf65
Posts: 7
Joined: Mon Dec 07, 2015 1:04 am

Re: Messed up

Post by Nightwolf65 » Tue Dec 08, 2015 3:26 pm

What does the dry_total_size stuff mean? Whatever I do I can't change the root password and its lost the password I gave it.
Attachments
image.png

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: Messed up

Post by Mijzelf » Tue Dec 08, 2015 6:10 pm

Nightwolf65 wrote:What does the dry_total_size stuff mean?
Don't know.
Whatever I do I can't change the root password and its lost the password I gave it.
You do have a rootshell in the screenshot. Where does that come from? How do you know the root password is not changed? Have you checked in /etc/shadow?

Code: Select all

grep ^root /etc/shadow
passwd
grep ^root /etc/shadow

Nightwolf65
Posts: 7
Joined: Mon Dec 07, 2015 1:04 am

Re: Messed up

Post by Nightwolf65 » Wed Dec 09, 2015 1:30 am

I have tried rebooting but it makes no difference. If I attempt to login through terminal as root it asks for the password but no matter what I try it always comes up access denied and asks for the password again. Even if I delete the password and check shadow to see its gone I can't access other than through telnet. I can still change other users passwords and they work, but I can't figure out why it won't let root login through ssh

Mijzelf
Posts: 6251
Joined: Mon Jun 16, 2008 10:45 am

Re: Messed up

Post by Mijzelf » Wed Dec 09, 2015 12:18 pm

Are you aware that it's common practise to deny root login on ssh? You are supposed to login as ordinary user, and then su to root.

The stock sshd from FFP doesn't enforce that, but maybe newer packages do.

Post Reply