Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I wanted to change the standard shell for my root user to bash but I got the path wrong. i typed /bin/bash instead of /opt/bin/bash. Now my /etc/passwd looks like this:

root:x:0:0:root:/root:/bin/bash

The problem is that I can no longer login via ssh. Additionally I can't su to root from an other user because of:

>su root
su: must be suid to work properly 

Any suggestions?

share|improve this question

4 Answers 4

up vote 4 down vote accepted

Even though these appliance type products are based on Linux it's generally a good idea not to try and customize them as though they're Linux boxes. They typically are missing most of the tools and are usually stripped down in various ways which can make this dangerous.

I've had experience with both Netgear's ReadyNAS box as well as the Thecus boxes and this has always been the case with both these types of products. You might want to consider doing a factory restore to get this back normal instead of hacking it your self.

You'll have to reconfigure the box but this is usually just setting the IP back up and potentially some user account creation.

I direct you to the actual pages from Synology that cover how to accomplish this:

share|improve this answer

Without becoming root by su. Use sudo to get your task done. for example in your case, you can use

sudo chsh -s /opt/bin/bash root

This changes shell for a specific user. Provide password when asked for.

Note: User should belong to sudoers group to use sudo.

share|improve this answer
1  
If you don't have access to sudo, you will need to reboot the computer in single-user mode to fix the password file. –  Jenny D Sep 10 '13 at 10:31
1  
The Note above will depend on the setup of the specific installation of sudo (some OS installations give certain users access to all commands, some do it by groups - not always the sudoers group - under Debian it is the sudo group, CentOS uses the vanilla wheel group). –  Drav Sloan Sep 10 '13 at 11:04
    
Unfortunately I am on a Synology NAS. There is no sudo installed. Also there is no Single-User mode available. I guess I have to hack me in via serial console: wrgms.com/post/37015296430/… –  harp Sep 10 '13 at 11:09

If you still have the root ("admin") password, you should be able to add another user from the web interface, which you can then give admin permissions to and try to fix things from another account.

Failing that, you might be able to reset the NAS settings (but still preserve your data) with slm's link (How to Reset the Synology System)

share|improve this answer

I had the same problem on a Synology DS212j, solved using the 3rd part package "config file editor". You can download the package from here . Remember to add /etc/passwd in the "Config file editor" configuration file, (it is the last one in the file list)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.