Problem with sudo/admin

feo

Honorary Master
Joined
Jan 22, 2006
Messages
13,722
Reaction score
109
Location
Pretoria, South Africa
Hi there

Complete linux n00b here.

I sometimes SSH into my QNAP NAS via PuTTy and noticed one day that when moving files around using sudo mv that it said sudo was an unknown user or something.

So I followed this and the sudo mv command worked but now I can't get into my NAS via SSH or WinSCP.

Help!
 
What happens when you try to login? Does it give you an error? Which user would you normally sign in with before you activated the root account?
 
I used to log in with admin/admin on my QNAP's web interface, PuTTy and WinSCP and I could do sudo commands fine.

It gives an error on the password, that it's incorrect.

PS. I didn't do steps 13-15 in the link I posted above.
 
Did you read and follow the comment from John?

That tutorial is 3+ years old, word of advice when playing with Linux always check tut date as they become irrelevant rather quickly.
 
Debian doesn't have sudo by default(depending on install), and it looks like CentOS is following path.
Code:
su -c 'apt-get install -y sudo'
OR
su -c 'yum install sudo -y'

Edit: I just saw the actual problem.
When booting the machine, and you get to the bootloader..
Press "e" for edit on the first line, change the last line of the printed text and append the single letter "s", for single-user mode.
You should get a root shell.

But wait... this doesn't look like a linux machine(ipkg), or perhaps Slackware?
 
Last edited:
That guide has a mistake in it.

Step 9 you make a copy of the "admin" user, and they probably wanted you to create a "root" user, but they left it as admin. I know this because if you look at step 11 you do the same thing, except there they didnt make a mistake.

You probably broke your /etc/passwd file now but having 2x "admin" user lines, and that probably is breaking your login authentication now. I see it is also mentioned in the comments, but the guy never fixed his guide. Pity.
 
if you are logging in as admin why are you using sudo? is admin not a superuser account?
 
That guide has a mistake in it.

Step 9 you make a copy of the "admin" user, and they probably wanted you to create a "root" user, but they left it as admin. I know this because if you look at step 11 you do the same thing, except there they didnt make a mistake.

You probably broke your /etc/passwd file now but having 2x "admin" user lines, and that probably is breaking your login authentication now. I see it is also mentioned in the comments, but the guy never fixed his guide. Pity.

How to fix it is the question then?
 
How to fix it is the question then?
You have to log in with another user and sudo, or you have to mount the media in another machine to fix the files on it. You need some way to get access to it basically. The other option is, firmware reset or flash if you can do that without logging in. Ive never had a qnap nas device so my experience with it is pretty limited, I can only give you general linux advice.
 
Update.

Did a factory reset to get back into the QNAP, which worked but that basically reset all my shares and I had to reinstall all apps I had running on the NAS. Still getting everything back up to the way it was before.

Unix really isn't very user friendly.
 
Update.

Did a factory reset to get back into the QNAP, which worked but that basically reset all my shares and I had to reinstall all apps I had running on the NAS. Still getting everything back up to the way it was before.

Unix really isn't very user friendly.

It's not Unix though, according to a quick Google search they use Linux. And yes, the command line can be a bit daunting if you are not familiar with it.

Nothing a good ol' reset can't fix though :D
 
Why did you expect user friendly after logging in via putty and started to mess around with the system?

Most devices if you start doing that, it voids your warranty.
 
Top
Sign up to the MyBroadband newsletter
X