TeraStation Pro II 使用手记

August 30, 2007 11:06 pm GMT-0700 | In Tech

English Translation: A quick summary

  • to get root privilege: compile acp_commander.java and run
    java acp_commander -o -t TeraStation_ip

    You may need to temporarily disable firewall on the machine that executes this command. You can then telnet in with empty root password, and set a password. Start sshd to have secure connection. Because it’s so easy to hack TeraStation, I think it can only be used in trustworthy local network.

  • Every time you restart TeraStation, you have to use acp_commander to start sshd, but root password is preserved.
    java acp_commander -c 'sshd' -t TeraStation_ip
  • To have special characters in the windows sharing password, just run passwd and smbpasswd under shell.
  • TeraStation supports rsync but rsync is only intended to be used between TeraStations. You could change /etc/rsyncd.conf to configure rsyncd server. Also, you can setup crontab job to rsync from TeraStation main disk to a USB disk plugged into TeraStation. This is obviously the best local backup method.

小日本作了一堆 TeraStation 文件服务器(民间 wiki民间论坛),卖得还不错。这玩意没什么特别的高科技成分,嵌入式 linux,加一堆软 raid。唯一比较赞的是机箱工艺比较好,体积也比较小。对于一般的应用,默认启动起来的 TeraStation 已经足够能用,但是没有 root 权限总是一件很不愉快的事情。下面简略记一下我对我们买的 TeraStation Pro II 的一些 hack。

默认的 TeraStation 对外只开了 web 管理界面和 smb 文件共享。但是它留了一个洞,可能是为了升级 firmware 方便。有人琢磨出来利用这个洞获得 root 权限,google acp_commander 就可以找到详细说明。acp_commander.java 源代码在 这里 备份一下。acp_commander 可以给 TeraStation 发送命令。执行

java acp_commander -o -t TeraStation_ip

清空 root 密码并启动 telnetd,然后 telnet 进去使用空密码登录 root 并设置密码。然后启动 sshd 就可以登录 ssh shell 了。一个要注意的问题是 acp_commander 需要接收 UDP 包,所以执行命令的这台机器需要临时关掉防火墙。

TeraStation 每次重启动会 reset 一些设置,所以需要重新用 acp_commander 来启动 sshd。注意 root 密码是不会被 reset 的,所以以后每次只要启动 sshd 即可,不需要清空 root 密码,也不需要再启动 telnetd 了。

java acp_commander -c 'sshd' -t TeraStation_ip

当然最彻底的方法是换掉 TeraStation 的 firmware,人民群众也已经创造了稳定的内核。不过我比较懒,所以还是用老的 firmware,反正我需要的功能都已经有了。另外,因为这个默认的 TeraStation fireware 这么容易被黑掉,所以建议只在可信赖的内网使用小日本的这个玩意儿。

TeraStation 的 web 界面相当的土鳖,不支持含有特殊字符的密码。大概看了一下貌似是因为 cgi 程序懒得处理这些特殊字符所以干脆禁止掉。当然,有了 shell 之后只要在 shell 下执行 passwd 和 smbpasswd 修改即可。ps 发现脚本到处都有日文注释,看来小日本写程序和有些中国人一样,也喜欢用母语注释。

TeraStation 本身支持 rsync 协议但是只是为了 TeraStation 之间备份用。有了 shell 之后可以修改 /etc/rsyncd.conf 来配置 rsync 服务器。当然也可以用 rsync over ssh,但是 TeraStation 的处理器不够强劲,高速解码 ssl 还是会影响一些性能。另外,从 raid 主盘往接在 TeraStation 上的 USB 盘备份可以在 crontab 设置 rsync,这应该是本地备份 TeraStation 最高效的方法。

Tags: , , ,

1 Comment »

RSS feed for comments on this post.

  1. http://forum.nas-central.org/viewtopic.php?f=19&t=4075

    Comment by bzhou — October 16, 2007 7:19 pm GMT-0700 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This weblog is licensed under a Creative Commons License.
Powered by WordPress. Theme based on Pool by Borja Fernandez.