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:


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?

4 Answers 4


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:


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.

  • 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
    Commented Sep 10, 2013 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
    Commented Sep 10, 2013 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
    Commented Sep 10, 2013 at 11:09

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)


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)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .