Enabling sshd for Buffalo Linkstation Live (LS-CHL)

THIS GUIDE IS FOR THE LS-CHL MODEL ONLY. ANY MODIFICATIONS ARE MADE AT YOUR OWN RISK. A MISTAKE CAN BRICK YOUR NAS

Buffalo @ nas-central.org is a good site for information on customising your linkstation live.

If unfamiliar with vi then find a Quick Guide to help you get by as vi is the main editor available to you.

Also, note that most of the commands are using BusyBox so may have limited functionality.

This guide is largely taken from Open Stock Firmware Guide with my commentary on how I overcame any problems. sshd is already available on the linkstation, it just needs switching on. ACP_Commander is the key to opening the initial access allowing you to make the necessary modifications.

Prerequesites

Steps

  1. Connect using acp_commander to reset the root password and open telnet:

    $ java -jar acp_commander.jar -t 192.168.xxx.xxx -o
    there seems to be no existing prefs, write default values
    ACP_commander out of the nas-central.org (linkstationwiki.net) project.
    Used to send ACP-commands to Buffalo linkstation(R) LS-PRO.
    
    WARNING: This is experimental software that might brick your linkstation!
    
    
    Using random connID value = BE442C00xxxx
    Using target:	192.168.xxx.xxx/192.168.xxx.xxx
    Starting authentication procedure...
    Sending Discover packet...	
    Found:	NAS (/192.168.xxx.xxx) 	LS-CHL(HANZEI) (ID=00016) 	mac: 00:1D:73:A3:xx:xx	Firmware=  1.20	Key=xxxxxxx
    Trying to authenticate EnOneCmd...	ACP_STATE_OK
    start telnetd...	OK (ACP_STATE_OK)
    Reset root pwd...	Password changed.
    
    
    You can now telnet to your box as user 'root' providing no / an empty password.
    
  2. Now telnet to your box with username ‘root’ and no password:

    $ telnet 192.168.xxx.xxx
    Trying 192.168.xxx.xxx...
    Connected to 192.168.xxx.xxx.
    Escape character is '^]'.
    
    NAS login: root
    No mail.
    
  3. Change the password to protect the box:

    # passwd
    Changing password for root
    Enter the new password (minimum of 5, maximum of 127 characters)
    Please use a combination of upper and lower case letters and numbers.
    New password: 
    Re-enter new password: 
    Password changed.
    
  4. Ensure there is a script to control sshd and that it has the correct permissions. My linkstation already had a script at /etc/init.d/sshd.sh. If not, find a suitable script from Open Stock Firmware Guide. To ensure the correct permissions:

    # chmod 0755 /etc/init.d/sshd.sh
    
  5. Ensure suitable configuration for sshd in /etc/sshd_config. I had to change UsePrivilegeSeparation from the default of yes to no as I was getting an error for users other than root sshing to the box.

  6. Backup the start up script and modify, adding telnetd between step 2 and 3 and sshd to step 3:

    # cp /etc/init.d/rcS /etc/init.d/rcS.bak
    # vi /etc/init.d/rcS
    

    Before (snippet starts on line 81):

    echo "** step2 **"                                                                                     
    for cmd in EnablingAutoip.sh usb.sh hotplug.sh networking.sh syslog.sh network_control.sh inetd.sh errormon.sh kernelmon.sh miconmon.sh checkSysMd.sh start_data_array.sh
    do                                                                                                                                                                       
            exec_sh ${cmd}                                                                                                                                                   
    done                                                                                                                                                                                                                                                                                                                          
    
    echo "** step3 **"                                                                                                                                                       
    for cmd in diskmon.sh drivecheck.sh ftpd.sh atalk.sh httpd.sh smb.sh clientUtil_servd.sh bonjour.sh lsprcvd.sh daemonwatch.sh cron.sh checkconfig.sh ups.sh pwrmgr.sh
    do                                                                                                                                                                           
            exec_sh ${cmd}                                                                                                                                                       
    done                                                                                                                                                                         
    

    After:

    echo "** step2 **"                                                                                     
    for cmd in EnablingAutoip.sh usb.sh hotplug.sh networking.sh syslog.sh network_control.sh inetd.sh errormon.sh kernelmon.sh miconmon.sh checkSysMd.sh start_data_array.sh
    do                                                                                                                                                                       
            exec_sh ${cmd}                                                                                                                                                   
    done                                                                                                                                                                     
    
    # telnetd for debug                                                                                                                                                      
    /usr/sbin/telnetd                                                                                                                                                        
    
    echo "** step3 **"                                                                                                                                                       
    for cmd in diskmon.sh drivecheck.sh ftpd.sh atalk.sh httpd.sh smb.sh clientUtil_servd.sh bonjour.sh lsprcvd.sh daemonwatch.sh cron.sh checkconfig.sh ups.sh pwrmgr.sh sshd.sh
    do                                                                                                                                                                           
            exec_sh ${cmd}                                                                                                                                                       
    done
    

Comments

blog comments powered by Disqus
Fork me on GitHub