Difference between revisions of "Enable SSH on LS-XL"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
(Instruction on how to enable SSH on LS-XL)
 
m (Added category)
 
Line 35: Line 35:
  
 
It could be rendered permanent by storing the <code>sshd_config</code> and <code>ssh_host_rsa_key</code> in a non-volatile folder like <code>/root</code>, and finding a way to launch <code>sshd -f /root/sshd_config</code> at system startup.
 
It could be rendered permanent by storing the <code>sshd_config</code> and <code>ssh_host_rsa_key</code> in a non-volatile folder like <code>/root</code>, and finding a way to launch <code>sshd -f /root/sshd_config</code> at system startup.
 +
 +
[[Category:LS-XL]]

Latest revision as of 21:50, 25 May 2014

Contents

Abstract

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

Notes

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.