Buffalo LS-XL 改机之 SSH 篇
  • 分类:Linux
  • 发表:2013-03-25
  • 围观(5,107)
  • 评论(4)

参考: http://nas1.cn/thread-25694-1-1.html

要想在 NAS 上实现靠谱的 BT、PT 甚至迅雷离线下载,必须完成本文的操作。NAS 本质是 Linux,这篇开始纯属 Linux 下捣鼓命令行,如果你连 Linux 是什么都不知道,谨慎看下去。

1.升级固件到最新版本

这里提供2个,一个是原厂固件1.64,一个是修改固件 1.64 mod1a。修改版多了几个比较实用的功能,比如 www server 和mysql server。下载到硬盘(建议在 D 盘新建一个目录 D:\NAS,相关下载都丢里面),解压后刷新,强烈建议在千兆局域网环境下升级 NAS,并完成后续的操作。如果你还是百兆网络,先升级你的交换机吧。如果这步都搞不定,后面也别看了,买群辉吧。

2.设置 root 帐号

要打开 SSH,就必须知道 root 帐号,但是 XL 只提供了 Web 登录的 admin 帐号,这个并不是 root 帐号,但是我们可以通过一个工具来设置 root 帐号。

先确认你电脑上装好了相应版本(x86或者x64)的 JRE,然后下载 acp_commander.jar ,放到 D:\NAS。然后在命令提示符下输入:

java -jar acp_commander.jar -t 192.168.1.5 -ip 192.168.1.5 -pw adminpassword -c "(echo newrootpass;echo newrootpass)|passwd"

注意,必须在 D:\NAS目录下执行这条命令,下同;请改成你自己的 NAS 的 IP;adminpassword 就是 web 登录的 admin 的密码,newrootpassword 就是你想要设置的 root 帐号密码。

这条命令的执行结果如下
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 = 1074348F3F6C
Using target:   LS-XL25C/192.168.1.5
Starting authentication procedure...
Sending Discover packet...
Found:  LS-XL25C(/192.168.1.5)       xxxxxxxx        mac: xx:xx:xx:xx:xx
Firmware=  1.640        Key=xxxxxx
Trying to authenticate EnOneCmd...      ACP_STATE_OK
Trying to authenticate with admin password...   ACP_STATE_OK
>(echo newrootpass;echo newrootpass)|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 bee
n set. Use the WebGUI to make appropriate settings.

注意必须有三个 ACP_STATE_OK(就是我用蓝色高亮的),后面绿色的 ERROR 不必理会。

3.启用 SSH

一次输入下面两条命令:

java -jar acp_commander.jar -t 192.168.1.5 -ip 192.168.1.5 -pw adminpassword -c "sed -i 's/UsePAM yes/UsePAM no/g' /etc/sshd_config"

java -jar acp_commander.jar -t 192.168.1.5 -ip 192.168.1.10 -pw adminpassword -c "sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/sshd_config"

注意 adminpassword 还是 admin 的密码,不是刚才设置的 root 密码!

最后重启 SSHD

java -jar acp_commander.jar -t 192.168.1.5 -ip 192.168.1.5 -pw adminpassword -c "/etc/init.d/sshd.sh restart"

然后就可以用 SSH 客户端登录 NAS 了。

共有 4 条评论

  1. christian louboutin shoes for men

    Buffalo LS-XL 改机之 SSH 篇 | 非礼勿视 spiked Christian Louboutin loafers http://spikedchristianlouboutinsandals.weebly.com/

  2. 被窝电影网

    就必须知道 root 帐号 在哪找

  3. SMT

    昨天给老机器换了硬盘,又折腾一遍。发现一个问题,java 命令输完后登不上ssh,原因是 /etc/melco/info 里的设置还是 SSH=off。解决方法是用 telnet 登录后,vi 修改。版本1.64mod1a。

Top