Enable SSH on LS-XL

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search


Shell access on LS-XL is a bit more difficult to enable than on other devices, for the following reasons:

  • telnet is not available on the system, so ACP Commander’s -o option does not work
  • The SSH daemon init script is disabled by default. Also, its default configuration seem to only allow SFTP access (but it is incomplete).

Usual notice

Do this at your own risk!

Required downloads

ACP Commander (from nas-central download page)

Commands to run

Replace $IP by the device’s IP, and $PASSWD by its password.

Create the sshd_config file

java -jar acp_commander.jar -t $IP -ip $IP -pw $PASSWD -c 'echo UsePAM no > /tmp/sshd_config'
java -jar acp_commander.jar -t $IP -ip $IP -pw $PASSWD -c 'echo Protocol 2 >> /tmp/sshd_config'
java -jar acp_commander.jar -t $IP -ip $IP -pw $PASSWD -c 'echo HostKey /tmp/ssh_host_rsa_key >> /tmp/sshd_config'
java -jar acp_commander.jar -t $IP -ip $IP -pw $PASSWD -c 'echo PermitRootLogin yes >> /tmp/sshd_config'

Generate the SSH key

java -jar acp_commander.jar -t $IP -ip $IP -pw $PASSWD -c 'ssh-keygen -t rsa -N "" -f /tmp/ssh_host_rsa_key 2>&1'

Set the root password

java -jar acp_commander.jar -t $IP -ip $IP -pw $PASSWD -c 'echo -e "[password]\n[password]" | passwd 2>&1'

Replace [password] by the password of your choice.

Start the sshd daemon

java -jar acp_commander.jar -t $IP -ip $IP -pw $PASSWD -c 'sshd -f /tmp/sshd_config 2>&1'

You should now be able to SSH root@$IP and login with the chosen password


This configuration is not permanent (except the root password setting); it will be lost at next reboot.

It could be rendered permanent by storing the sshd_config and ssh_host_rsa_key in a non-volatile folder like /root, and finding a way to launch sshd -f /root/sshd_config at system startup.