[GUIDE] Reset Button script that enables SSH


#1

This is another modified version of Western Digital’s resetButtonAction.sh script but this one does everything the original script does as well as enabling SSH access

I highly recommend replacing Western Digital’s default script with this one as it at least gives you some sort of safety net in the event you run into problems down the road and SSH is NOT enabled

  1. Download the script from http://www.mediafire.com/?wji7egd4j752j6i

  2. Unzip resetwithssh.zip

  3. Enable SSH access on your MyBookLive by going to http://mybooklive/UI/ssh

  4. Windows users download  WinSCP from http://winscp.net/download/winscp510setup.exe
     3a) Mac users download CyberDuck from http://cyberduck.ch/Cyberduck-4.2.1.zip

  5. Windows users start WinSCP and enter the login info…Host: mybooklive  Username: root  Password: welc0me
     4a) Mac users start CyberDuck to login to the MyBookLive using SFTP  Host: mybooklive  Username: root  Password: welc0me  Port: 22

  6. Copy resetButtonAction.sh that you unzipped in step 2 to /usr/local/sbin and when asked, overwrite the existing file

  7. Done

Western Digital’s original script

#!/bin/sh
#!/bin/sh
#
# © 2010 Western Digital Technologies, Inc. All rights reserved.
#
# resetButtonAction.sh 
#
# This is called by resetbtnd whenever the reset button has met the criteria for a reset. This script implements the actions for the reset button.
#
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

logger "reset button pressed, invoking reset actions"

# remove owner password
owner=`getOwner.sh`
modUserPassword.sh ${owner}

# set root password back to default
echo "root:welc0me" | chpasswd 

# set network to dhcp
setNetworkDhcp.sh

reboot

 Modified Script

 

#!/bin/sh
#!/bin/sh
#
# © 2010 Western Digital Technologies, Inc. All rights reserved.
#
# resetButtonAction.sh 
#
# This is called by resetbtnd whenever the reset button has met the criteria for a reset. This script implements the actions for the reset button.
#
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

logger "reset button pressed, invoking reset actions"

#enable ssh
echo "enabled" > /etc/nas/service_startup/ssh

# remove owner password
owner=`getOwner.sh`
modUserPassword.sh ${owner}

# set root password back to default
echo "root:welc0me" | chpasswd 

# set network to dhcp
setNetworkDhcp.sh

reboot

 


[GUIDE] Fix Dashboard Errors 3xxxx
[GUIDE] Build a Custom Firmware
[GUIDE] How to unbrick a totally dead MBL
[GUIDE] Fix Dashboard Errors 3xxxx
#2

Upload coming…

EDIT: Upload complete


#3

Tried this, the script froze on me and now I am no longer able to connect (ssh)… help?


#4

This script is for the MyBookLive… I have never looked at the MyBookLive DUO script so that may be your problem