Buffalo NAS-Central Forums
http://forum.buffalo.nas-central.org/

How to permanently enable SSH on LS-XL?
http://forum.buffalo.nas-central.org/viewtopic.php?f=68&t=44387
Page 1 of 1

Author:  rikkib [ Wed Feb 15, 2017 8:45 pm ]
Post subject:  How to permanently enable SSH on LS-XL?

Hi guys,

I'm not 100% sure this is the correct forum for the LS-XL, my apologies if it's not.

I have been trying for a while now to get permanent SSH access on my LS-XL. I can get temp access using ACP Commander but cannot find a way to get SSHD to load at startup. All my changes just get wiped after a reboot. Is there anywhere I can place my 'sshd -f' line to auto start my config?

Is there an image that is written at boot that I can extract to add my code in with the temp SSH access?

Or if it's easier, all I really need is the ability to shutdown the LS-XL via a Linux box connected to a UPS. A script is called when the UPS is low and shuts down my other servers. Maybe there is a curl call or something I can use to just shut the system down cleanly from a script?

Thanks.

Author:  oxygen8 [ Wed Feb 15, 2017 9:18 pm ]
Post subject:  Re: How to permanently enable SSH on LS-XL?

Code:
java -jar acp_commander.jar -t NAS_IP -ip NAS_IP -pw adminpassword -c "(echo newrootpass;echo newrootpass)|passwd"
java -jar acp_commander.jar -t NAS_IP -ip NAS_IP -pw adminpassword -c "sed -i 's/UsePAM yes/UsePAM no/g' /etc/sshd_config"
java -jar acp_commander.jar -t NAS_IP -ip NAS_IP -pw adminpassword -c "sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/sshd_config"
java -jar acp_commander.jar -t NAS_IP -ip NAS_IP -pw adminpassword -c "sed -i '15,19d' /etc/init.d/sshd.sh"
java -jar acp_commander.jar -t NAS_IP -ip NAS_IP -pw adminpassword -c "/etc/init.d/sshd.sh restart"


from
http://forum.nas-hilfe.de/buffalo-technology-nas-anleitungen/fw-1-56-offen-ssh-auf-eine-ls-chlv2-fw-1-56-t1220.html

Author:  rikkib [ Wed Feb 15, 2017 9:58 pm ]
Post subject:  Re: How to permanently enable SSH on LS-XL?

That doesn't seem to have worked. After entering the commands, there is no SSH open, I even tried rebooting.

This is the output from CMD:

Code:
C:\>java -jar acp_commander.jar -t 192.168.10.7 -ip 192.168.10.7 -pw <myPass> -c "(echo <myPass>;echo <myPass>)|passwd"
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 = B82FA2263FBB
Using target:   LS-XL64F/192.168.10.7
Starting authentication procedure...
Sending Discover packet...
Found:  LS-XL64F (/192.168.10.7)        LS-XL(SHOUTOKU) (ID=00025)      mac: B0:C7:45:67:56:4F  Firmware=  1.710        Key=047CB541
Trying to authenticate EnOneCmd...      ACP_STATE_OK
Trying to authenticate with admin password...   ACP_STATE_OK
>(echo <myPass>;echo <myPass>)|passwd
OK (ACP_STATE_OK)
Changeing IP:   ACP_STATE_PASSWORD_ERROR
Please note, that the current support for the change of the IP is currently very rudimentary.
The IP has been set to the given, fixed IP, however DNS and gateway have not been set. Use the WebGUI to make appropriate settings.

C:\>java -jar acp_commander.jar -t 192.168.10.7 -ip 192.168.10.7 -pw <myPass> -c "sed -i 's/UsePAM yes/UsePAM no/g' /etc/sshd_config"
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 = 1840825FEBC9
Using target:   LS-XL64F/192.168.10.7
Starting authentication procedure...
Sending Discover packet...
Found:  LS-XL64F (/192.168.10.7)        LS-XL(SHOUTOKU) (ID=00025)      mac: B0:C7:45:67:56:4F  Firmware=  1.710        Key=7E85D532
Trying to authenticate EnOneCmd...      ACP_STATE_OK
Trying to authenticate with admin password...   ACP_STATE_OK
>sed -i 's/UsePAM yes/UsePAM no/g' /etc/sshd_config
OK (ACP_STATE_OK)
Changeing IP:   ACP_STATE_PASSWORD_ERROR
Please note, that the current support for the change of the IP is currently very rudimentary.
The IP has been set to the given, fixed IP, however DNS and gateway have not been set. Use the WebGUI to make appropriate settings.

C:\>java -jar acp_commander.jar -t 192.168.10.7 -ip 192.168.10.7 -pw <myPass> -c "sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/sshd_config"
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 = BC2207982B8A
Using target:   LS-XL64F/192.168.10.7
Starting authentication procedure...
Sending Discover packet...
Found:  LS-XL64F (/192.168.10.7)        LS-XL(SHOUTOKU) (ID=00025)      mac: B0:C7:45:67:56:4F  Firmware=  1.710        Key=5C3F15A9
Trying to authenticate EnOneCmd...      ACP_STATE_OK
Trying to authenticate with admin password...   ACP_STATE_OK
>sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/sshd_config
OK (ACP_STATE_OK)
Changeing IP:   ACP_STATE_PASSWORD_ERROR
Please note, that the current support for the change of the IP is currently very rudimentary.
The IP has been set to the given, fixed IP, however DNS and gateway have not been set. Use the WebGUI to make appropriate settings.

C:\>java -jar acp_commander.jar -t 192.168.10.7 -ip 192.168.10.7 -pw <myPass> -c "sed -i '15,19d' /etc/init.d/sshd.sh"
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 = B69E92ABFFAE
Using target:   LS-XL64F/192.168.10.7
Starting authentication procedure...
Sending Discover packet...
Found:  LS-XL64F (/192.168.10.7)        LS-XL(SHOUTOKU) (ID=00025)      mac: B0:C7:45:67:56:4F  Firmware=  1.710        Key=70A3569E
Trying to authenticate EnOneCmd...      ACP_STATE_OK
Trying to authenticate with admin password...   ACP_STATE_OK
>sed -i '15,19d' /etc/init.d/sshd.sh
OK (ACP_STATE_OK)
Changeing IP:   ACP_STATE_PASSWORD_ERROR
Please note, that the current support for the change of the IP is currently very rudimentary.
The IP has been set to the given, fixed IP, however DNS and gateway have not been set. Use the WebGUI to make appropriate settings.

C:\>java -jar acp_commander.jar -t 192.168.10.7 -ip 192.168.10.7 -pw <myPass> -c "/etc/init.d/sshd.sh restart"
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 = 85E6822A5E67
Using target:   LS-XL64F/192.168.10.7
Starting authentication procedure...
Sending Discover packet...
Found:  LS-XL64F (/192.168.10.7)        LS-XL(SHOUTOKU) (ID=00025)      mac: B0:C7:45:67:56:4F  Firmware=  1.710        Key=69ACA8E6
Trying to authenticate EnOneCmd...      ACP_STATE_OK
Trying to authenticate with admin password...   ACP_STATE_OK
>/etc/init.d/sshd.sh restart
OK (ACP_STATE_OK)
Changeing IP:   ACP_STATE_PASSWORD_ERROR
Please note, that the current support for the change of the IP is currently very rudimentary.
The IP has been set to the given, fixed IP, however DNS and gateway have not been set. Use the WebGUI to make appropriate settings.

Author:  oxygen8 [ Wed Feb 15, 2017 10:02 pm ]
Post subject:  Re: How to permanently enable SSH on LS-XL?

Retry the last command.

There must be an answer.

Author:  rikkib [ Wed Feb 15, 2017 10:09 pm ]
Post subject:  Re: How to permanently enable SSH on LS-XL?

I tried to do the last command again and I get the same output.

Code:
C:\>java -jar acp_commander.jar -t 192.168.10.7 -ip 192.168.10.7 -pw <myPass> -c "/etc/init.d/sshd.sh restart"
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 = 75859510746E
Using target:   LS-XL64F/192.168.10.7
Starting authentication procedure...
Sending Discover packet...
Found:  LS-XL64F (/192.168.10.7)        LS-XL(SHOUTOKU) (ID=00025)      mac: B0:C7:45:67:56:4F  Firmware=  1.710        Key=3664953E
Trying to authenticate EnOneCmd...      ACP_STATE_OK
Trying to authenticate with admin password...   ACP_STATE_OK
>/etc/init.d/sshd.sh restart
OK (ACP_STATE_OK)
Changeing IP:   ACP_STATE_PASSWORD_ERROR
Please note, that the current support for the change of the IP is currently very rudimentary.
The IP has been set to the given, fixed IP, however DNS and gateway have not been set. Use the WebGUI to make appropriate settings.

C:\>


I have disabled the firewall, it did error out with that enabled.

Author:  rikkib [ Wed Feb 15, 2017 10:44 pm ]
Post subject:  Re: How to permanently enable SSH on LS-XL?

If I enable SSH the temp way and run the last line I see an error:

Code:
/etc/init.d/sshd.sh restart
/etc/init.d/sshd.sh: line 9: t: command not found

Author:  rikkib [ Wed Feb 15, 2017 11:26 pm ]
Post subject:  Re: How to permanently enable SSH on LS-XL?

OK, so I solved it.

Thanks for those commands they helped point me in the right direction. The problem was my /etc/init.d/sshd.sh file was there but did not have the correct contents (only about 20 lines). I downloaded a sample sshd.sh and ran the '/etc/init.d/sshd.sh restart' command and it then generated the keys and SSH was running. I rebooted and it stayed this time.

Thanks a lot, I appreciate it.

Author:  oxygen8 [ Thu Feb 16, 2017 8:41 am ]
Post subject:  Re: How to permanently enable SSH on LS-XL?

Ok, my howto is only working with an unmodified sshd.sh

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/