LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-14-2010, 03:35 PM   #1
kwiksand
Member
 
Registered: Jun 2003
Location: Perth, AUS
Distribution: Gentoo
Posts: 35

Rep: Reputation: 15
Locked out of linux based NAS (QNAP TS-409Pro) -- My fault though


Hey guys,

A couple of weeks I was improving my home NAS a little by adding cron scripts for backups and a couple of things, I've been logging in for a while and starting bash (installed with busybox) as its a little more feature filled than the terminal that comes default. Anyway, I'd done it so often (started /bin/bash, that is), and without thinking added /bin/bash as the login shell for the admin user (the only ssh account, unfortunately), without thinking that the the file doesn't actually appear until after my path has been built and the busybox sym-links are installed. So basically now I can't login as its not pointing at a valid root shell.

The things I’ve tried so far are:

- Basic telnet/SSH login attempts, running a command as part of the SSH statement (i.e ssh admin@qnap.****.local cat /etc/passwd)
- Issue chsh to attempt a login shell change (ssh admin@qnap.****.local chsh /bin/sh)
- Writing a dodgy web script (total failure)
- Writing one of the QNAP installable packages (a QPKG) which appear to have elevated system privileges during install (can’t find enough information)
- I can’t take the drive(s) out to replace the file easily as its 4x drives in RAID-5 and I don’t have a PC to load them into
- I also can’t wipe the device as it (to my knowledge) deletes all data off the drives in the process.

Any ideas, short of me buying a couple of 2TB drives to back everything up on to whilst I wipe it, I would just unplug all the drives and rebuild the mdadm software raid array temporarily on another machine, but I just don't have access to a computer at the moment, all I've got is laptops, we use macbooks at work and every single one of my friends owns a laptop too :P
 
Old 01-15-2010, 07:25 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Have you tried booting off a usb stick and recovering that way ?
 
Old 01-15-2010, 07:32 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
I am not familiar with this particular device but AFAIK the drives just store data. I would say the operating system resides in flash memory and is part of the embedded computer. There might be a reset button but it probably just resets passwords and loads a default configuration as when you first turn it on. If you can not reload the OS from its web page tool I'm not sure there is anything you can do without being able to access an internal console port if one exists. You might want to contact the QNAP to seek their help.
 
Old 01-17-2010, 10:05 AM   #4
kwiksand
Member
 
Registered: Jun 2003
Location: Perth, AUS
Distribution: Gentoo
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks for your replies, I'm looking into booting off a USB stick now, it's headless though so it makes it difficult to do any kind of debugging?

There's a reset button on the device, but I've done a bit of reading and apparently it kills data too from the RAID array.
 
Old 01-17-2010, 02:45 PM   #5
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
You may be able to attach a usb serial adapter as well and redirect the console to another pc via minicom or hyperterm...
 
Old 01-17-2010, 04:53 PM   #6
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553

Rep: Reputation: 115Reputation: 115
Would port forwarding get you anywhere? Does the system have any other users than root, and might they be able to ssh or telnet from the router to itself? (EDIT: I may have got confused about exactly how port forwarding works here.)

Do sftp or scp work, or any other file copying protocol? That would let you upload a new /etc/passwd to fix the problem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux-based NAS device starts at $70 LXer Syndicated Linux News 0 11-17-2009 09:00 PM
LXer: QNAP TS-409U Turbo NAS LXer Syndicated Linux News 0 07-15-2008 09:30 AM
QNAP NAS-server under Linux? ronald-be Linux - Hardware 2 09-16-2007 05:31 AM
linux based nas and xbmc and mp101 wallace4793 Linux - Networking 2 04-04-2007 04:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration