1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Reset password NAS-200

Discussion in 'Cisco/Linksys Network Storage Devices' started by kuba74, Sep 3, 2009.

  1. kuba74

    kuba74 Guest


    I've big problem with root password. I install jac4 software on my NAS200. But the problem is with root pass. It don't function. Could some tell My how can't reset pass. I cant find information on the forum about start scripts to reset pass.
  2. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    If you're running in a RAID configuration, the changed root password doesn't get copied to the hard disk correctly. This is a known bug and I'm working on an update (which is progressing very slowly, I'm ashamed to say).

    Until then, simply create a script "rc.resetrootpassword" in the "rc.d" directory under the DISK 1 share (for example), containing the following:

    # rc.resetrootpassword
    # This file, if placed in the rc.d directory on one of your harddisks
    # as rc.resetrootpassword, will change the root password to "root"
    # (without the quotes). Other accounts will not be touched.
    # Don't forget to change the password from Telnet or SSH and
    # remove this file, otherwise it will be reset every time you 
    # start the NAS!
    egrep "^root:" /etc.default/passwd >/etc/x
    egrep -v "^root:" /etc/passwd >>/etc/x
    for x in 1 2 3 4 5 6;do cp /etc/passwd /harddisk/volume_$x/conf/passwd;done
    Remember you have to use a Unix compatible editor to write the script so that it has Linefeed-only line breaks. The NAS can't run scripts with Carriage-Return+Line Feed line endings.

    If you don't have an editor like that, you can download the script from my website at http://www.goudsm.it/nas200/resetrootpassword.zip .
    1. Unpack the zip file in the rc.d directory under the root directory of one of your disks
    2. Reboot (push the power button, wait until lights go off, then push power button again, wait for double-beep)
    3. Log in through SSH as root, password root
    4. Use the passwd command to change your password, followed by the "for" command shown above to store the password file persistently
    5. Remove the rc.resetrootpassword script so the password won't get reset again on the next boot.

  3. frisa

    frisa Addicted to LI Member

    modification of etc/passwd

    Hi all
    I have a similar problem.
    No user can connect by the scp protocol.

    I will try to explain the situation (sorry for my poor english).

    1- i had update the firmware with the Jac4's one.
    2- i changed the password of root.

    At that stage, i only can use the initial web interface with user account (guest or maela in my nas200) but not with admin or root accounts.

    Question 1 : is it possible to get a web interface for administration actions ?

    Question 2 : How can i come back to a standart firmware ?

    3- i changed a little in fact one line of the file etc/passwd
    inital : admin:cipher_text:502:501::/home/user/admin:/dev/null1

    modified : admin:cipher_text:502:501::/home/user/admin:/dev/null0

    Now i can get the admin account by a web interface but it is not an administration account any more.

    4- maela is an account with limited right (only a public part of the disk can be access).
    This is the part of the disk that i want to access from internet (versus local access). So i modified etc/passwd

    inital :

    modified :

    it works with WinSCP but i can see all the disk and not only the public part.
    So i modified again etc/passwd


    Now, nothing works. I can't acces using the scp protocol.
    I can't log in with root account.

    Question 3 : how can i modify the etc/passwd file.
    In the first answer to kuba74, jac_goudsmit proposed to put a script file
    in a special location of the disk.

    I'm not sure to understand how to do that.
    May i have to extract the disk from the nas200 and read/write on it as a extrenal disk ?

    That's all folk.
    Thanks a lot for this forum.

    If my description is not clear, fell free for asking me additionnal information.

    More generaly, i wants to access from internet to my nas200 only with limited right.

    It is possible to use the web interface for the administration (root) if we do not want to use this account from internet with the SCP protocol.

  4. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    The admin password doesn't get changed by updating to Jac4. You cannot use the root account with the web GUI, FTP and Samba and you cannot use admin and the accounts that you created from the web GUI with SSH and SCP.

    You should use the admin account (or any account that you gave admin access) with the web GUI.

    Download the standard firmware from the Linksys website and flash it from the web GUI. Obviously you need the admin web GUI.

    The "/dev/null0" or "/dev/null1" is used by the Linksys software to determine if an account has access to the web admin GUI. By making this change, you turned off access to the admin web GUI to the admin account. If you change it back, your admin account will be able to access the full web GUI again.

    This is by design. While the FTP and Samba servers (modified by Linksys) show a pseudo file system that only contains the areas that are available to users as you configured, the SSH server (which also handles SCP) shows the entire file system. That means that access to files is controlled by file access rights, not by the web GUI controls.

    Unless the /harddisk/volume_1/data/public directory doesn't exist, you should still be able to log in. Did you try restarting the NAS? Maybe you kept all your connections open and it ran out of terminals (only 2 sessions at the same time are supported I think).

    Again: Maybe your NAS ran out of terminal sessions, try restarting it. If you changed the root password to something you don't remember, keep reading...

    You can either create the script I've shown earlier in this thread, or follow these steps to reset the NAS200 root password to "root":
    1. Create a directory "rc.d" (all lower case) in the "DISK 1" shared directory
    2. Download this file and unzip the file in the rc.d directory. You should now see a file "rc.resetrootpassword" in the rc.d directory. Don't modify it!
    3. Turn off the NAS with the power button and turn it back on. The script restarts the NAS so you will hear a beep, then (after a while) another beep, then (after a while) two beeps.
    4. After you hear the double beeps, your root password is reset to "root" and the script will be renamed to "password_reset_done". You can delete it and you can also delete the zip file.

    That shouldn't be necessary. Unless you removed access to the DISK 1 share for all users of course.

    If you want to do this, you will be fighting the software that's already on board. For example all users are in the everyone group, and all files are created with read/write access to everyone. The stock firmware presents a pseudo filesystem to deny access to accounts that are not allowed to have access, but SSH doesn't, and it's not designed to do that. If you want to accomplish that, you will either have to modify the SSH server or let it run the SCP part in a chroot or something.

    I'm not sure what you're trying to say here, but once again, the web GUI accounts cannot use SSH, and the SSH accounts cannot use the web GUI, because access to the web GUI is controlled by the shell field in the passwd line. So you can't use the root account to connect to the web GUI, if that's what you're asking.

    Anyway, next time you make changes to system files, make sure you don't paint yourself into a corner like you did this time. For example, if you modify a line in /etc/passwd that takes access away for the root account, copy the old line and change the name to "root2" or something so if you make a mistake you can always log in as "root2" to undo your change.

  5. frisa

    frisa Addicted to LI Member

    Thanks a lot for your answer.
    It's a real pleasure to find some help.

    After restaring the nas200, the web GUI for the admin account works.

    I will try to re start at the beginning for linux administration with commands line.

    I will just explain what i tried to say the last time (apologizes for my english).

    root is a critical account and i don't want to do remote administration.
    I want to use this account only from the local network (ssh or web GUI).

    Thanks again and perhaps a next time (i have to work)

  6. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    It's not possible to filter logins by IP addresses so it's not possible to let some accounts login from the Internet and some from only the LAN.

    If you allow logins on SSH (port 22) from the Internet, I recommend using a strong root password.

  7. hmiprueba

    hmiprueba Reformed Router Member

    I have a problem with the UFS200!.
    I followed all steps until connect my usbdrive to NAS200, and then at power my NAS200 to follow with the configuration of the UFS200. I can not enter via SCP, either with putty, I can not see it on my network.
    I turn off the NAS200, remove the usbdrive usb1 port, and everything returns to normal.
    Clarified that the usbdrive works perfectly.
    I really want to see how the USF200 if anyone is interested or could already set, it really would be grateful for help.

Share This Page