General NAS-Central Forums

Welcome to the NAS community
It is currently Wed Dec 13, 2017 10:42 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Messed up
PostPosted: Mon Dec 07, 2015 1:15 am 
Offline

Joined: Mon Dec 07, 2015 1:04 am
Posts: 7
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.


Top
 Profile  
 
 Post subject: Re: Messed up
PostPosted: Mon Dec 07, 2015 6:55 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
Your truncated command does nothing. So it's not clear how it can kill your root access.


Top
 Profile  
 
 Post subject: Re: Messed up
PostPosted: Mon Dec 07, 2015 8:01 pm 
Offline

Joined: Mon Dec 07, 2015 1:04 am
Posts: 7
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.


Top
 Profile  
 
 Post subject: Re: Messed up
PostPosted: Tue Dec 08, 2015 9:00 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
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?


Top
 Profile  
 
 Post subject: Re: Messed up
PostPosted: Tue Dec 08, 2015 3:26 pm 
Offline

Joined: Mon Dec 07, 2015 1:04 am
Posts: 7
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
image.png [ 183.52 KiB | Viewed 1414 times ]
Top
 Profile  
 
 Post subject: Re: Messed up
PostPosted: Tue Dec 08, 2015 6:10 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
Nightwolf65 wrote:
What does the dry_total_size stuff mean?
Don't know.
Quote:
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:
grep ^root /etc/shadow
passwd
grep ^root /etc/shadow


Top
 Profile  
 
 Post subject: Re: Messed up
PostPosted: Wed Dec 09, 2015 1:30 am 
Offline

Joined: Mon Dec 07, 2015 1:04 am
Posts: 7
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


Top
 Profile  
 
 Post subject: Re: Messed up
PostPosted: Wed Dec 09, 2015 12:18 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6090
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group