Difference between revisions of "Hacking"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m (Moved to talk)
 
(37 intermediate revisions by 10 users not shown)
Line 1: Line 1:
That is what this site is intended for:
+
{{Template:Articles|Terastation}}
 +
 
 +
'''N.B. There is also some potentially useful information in the [[Talk:Hacking|discussion page]] corresponding to this article, which needs refactoring.'''  If you would like to add to the wiki, please first think which bit of which page is the most appropriate home for your contribution - thanks!
  
 
== Hardware Hacking ==
 
== Hardware Hacking ==
  
* Adding a [[serial console]].
+
* Adding a [[Terastation Serial console]].
 
* [[become root]]: firmware version [[become root (1.04)|1.04]]
 
* [[become root]]: firmware version [[become root (1.04)|1.04]]
 
* [[moving disks]]: change the firmware by moving the disks to a PC.
 
* [[moving disks]]: change the firmware by moving the disks to a PC.
Line 17: Line 19:
  
 
Dave Walker created a hacked firmware that you can just download and use (Thank you Dave!):
 
Dave Walker created a hacked firmware that you can just download and use (Thank you Dave!):
  http://homepage.ntlworld.com/itimpi/buffalo.htm
+
* http://homepage.ntlworld.com/itimpi/buffalo.htm
  mirror: http://supportonsite.dk/files.php
+
* mirror: http://supportonsite.dk/files.php
  minimalistic (ssh only): http://blog.kevinashley.com/articles/2006/04/14/minimalistic-terastation-1tb-hacking-to-allow-proper-rsync-and-ssh
+
* minimalistic (ssh only): http://blog.kevinashley.com/articles/2006/04/14/minimalistic-terastation-1tb-hacking-to-allow-proper-rsync-and-ssh
 
+
Success count (if you are successful, please add to this list):
+
#[[User:Bluefedora|Bluefedora]], 1.12, 2005-11-18
+
#* added dropbear as outlined below
+
# Jones, 1.12, 2005-10-11
+
#* Hacking with SSH and SAMBA 3.0.14a (Debian package).
+
#* Now I am shooting on the problem of led (STATUS/FULL) not working properly.
+
# yukiman, 1.12, 2005-12-03
+
#* Used Dave's firmware with 1.12 installed and update worked fine, logged in now via telnet.
+
#* Got dropbear working as well.
+
# [[User:mh123083|mh123083]], 1.12, 2006-01-13
+
#* Used Dave's firmware with dropbear and allnfs - works perfectly.
+
# [[User:alun|alun]], 1.12, 2006-01-19
+
#* Used Dave's firmware. Updated from (factory) 1.08. Have not installed anything else yet. Worried about possible nfs problems...
+
# [[User:SKarp|SKarp]] 18:38, 2 Feb 2006 (CET)
+
#* Updated from stock 1.03 to Dave's firmware 1.12 and added allnfs.  Working fine in early testing.
+
# [[User:raphael|Raphaël]] 22:55, 24 Mar 2006 (JST)
+
#* Updated from 2.03 to Dave's 2.03, works fine.
+
#* 2.05a didn't work and left my box flat, but an upgrade to 2.03 afterwards restored the situation.
+
# poxy bowsy 9 April 2006
+
#* Updated from 1.12 to Dave's 2.05a, but install failed, unit was EM'ed
+
#* reinitialized and tried to revert to 1.12a but unit was still EM'ed
+
#* reinitialized and tried to revert to stock 1.12 but unit was still EM'ed
+
#* reinitialized and installed 2.05a again and everything seems fine (whew)
+
# [[Ringgh0st]], 1.12 2006-04-10
+
#* upgraded to Dave's hacked Firmware v1.12 on a v1.12 Terastation
+
#* added Midnight Commander (starts with a little codepage fault, but notthing really important)
+
#* didnt get the lundftpd working yet, the service doesnt start (no errorlog), if i try to start it manually with the -v string a "segmentation fault" pops up
+
# torbens
+
#* 27 April 2006: 1st station updated to Dave's v2.08a using Japanese firmware updater
+
#* 29 April 2006: 2nd station updated to Dave's v2.08a using Japanese firmware updater (had to use recovery with powerbutton on diag.)
+
#* 1 Juli 2006: 3rd station pro updates to Dave's v1.03 using Japanese firmware updater
+
# Risse-it 02.05.2006
+
#* Updated TS0.6GB from 1.12 to minimalistic (ssh only)
+
#* didn't reboot after installing MC and disc-tuning via hdparm (don't know which was the problem - i did both)
+
#* restored by mounting the first IDE-drive to my Gentoo-x86 (xfs_repair -L) and copied the imagefiles from minimalistic
+
#* hdparm now runs with -d1 -c1 -m16 -a64 -A1 -u1 -k1 -S241 (any suggestions?)
+
#* patched some .cgi and .pl-files for more statistics (anyone who's running rrdtool or any other statistics???)
+
#* USB-printer will only print from Windows (VMware) and not via smb from Gentoo or Ubuntu (Epson Stylus Color C82)
+
#* patched mail-notifier (to do smtp-auth)
+
# Entropy 2006-May-20
+
#* [http://www.megaupload.com/?d=G6269VIG Updated Terastation Pro firmware] 1.01 with dropbear and nfs user space daemons
+
#* [http://www.terastation.org/wiki/TeraStationPro#Non-Official_Firmware Test Firmware] 1.01 with openssh, nfs v3, etc.
+
# --[[User:Luminaire|Luminaire]] 11:14, 31 May 2006 (CEST)
+
#* Used successfully on TS HD-H1.0TGL/R5 (1.12 firmware).  Works a treat.  Going to try NFS/NIS.
+
Used successfully on TS-1.0TGL/R5 Works but damn is this thing slow.  Truly bound by pathetic CPU.  Doesn't even begin to test the Gigabit network
+
# -- [[User:Kimbotha|Kimbotha]] 14:57, 25 October 2006 (CEST)
+
#* 24 October 2006: Updated new 1TB Terastation from v1.12 to Dave's v2.10a - Failed first time, reapplied v2.10a and it nows works fine.
+
#* Installed dropbear following instructions successfully
+
#* Tried to install kernel mode nfs as per instructions but failed to load modules
+
#* installed user mode nfs as per Entropy's instructions successfully
+
#* currently looking to build a cross toolchain so I can build unfs3 as I need >2GB file support
+
# -- [[User:Kimbotha|Kimbotha]] 16:37, 25 October 2006 (CEST)
+
#* While collecting the components to try and start build a cross compile toolchain I found an set of nfs kernel modules and the nfs kernel daemon here (http://downloads.linkstationwiki.net/terastation/kernel_modules/). These seem to load fine on my TS (with a change to the /etc/init.d/nfs-kernel-server to allow rpc.mountd to start). Will try and run some tests on >2GB files when I have some on there to work with.
+
  
 
== Software for the TeraStation ==
 
== Software for the TeraStation ==
Line 83: Line 31:
 
(NB I wanted to upload a .tgz but the Wiki didn't let me, saying that .tgz was not an accepted image format. --[[User:Fred|Fred]] 12:05, 12 Dec 2005 (CET))
 
(NB I wanted to upload a .tgz but the Wiki didn't let me, saying that .tgz was not an accepted image format. --[[User:Fred|Fred]] 12:05, 12 Dec 2005 (CET))
  
=== Dropbear ===
+
 
 +
 
 +
=== Dropbear sshd ===
  
 
A small ssh server. [http://matt.ucc.asn.au/dropbear/dropbear.html home page]
 
A small ssh server. [http://matt.ucc.asn.au/dropbear/dropbear.html home page]
Line 114: Line 64:
  
  
Can i setup publick key authentication on dropbear. If so can someone give me an example. I was able to upgrade the firmware succesffully on the Terastation Pro. I am planning to do a Public Key Authentication on my mac and use rsync for backup using ssh protocol. Any ideas?
+
Can I setup public key authentication on dropbear. If so can someone give me an example. I was able to upgrade the firmware successfully on the Terastation Pro. I am planning to do a Public Key Authentication on my mac and use rsync for backup using ssh protocol. Any ideas?
 
Thanks a gazillion,
 
Thanks a gazillion,
 
Naven
 
Naven
Line 132: Line 82:
 
Now you can connect to your Terastation by using public key authentication
 
Now you can connect to your Terastation by using public key authentication
  
=== Midnight Commander ===
+
=== OpenSSH ===
  
For a description on how to install, see [[Midnight Commander]].
+
Here's a [http://homepage.ntlworld.com/itimpi/buffalo.htm#PACKAGES Terastation version].
  
=== Encryption, NTFS Support, and Windows Share Management ===
+
=== OpenSSL and OpenSSH and using Winscp (Putty) to Access with Windows ===
  
[[User:Aaron|Aaron]] explains how he converted his TeraStation to an ETH-disk and
+
Download:
gained [[Encryption, NTFS Support, and Windows Share Management]] by using an
+
* [http://winscp.net/ WinScp]
additional Windows system.
+
* [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty]
 +
* [http://freenet-homepage.de/inputsammler/openssh-3.0.2p1.tar.gz Openssh]
 +
* [http://freenet-homepage.de/inputsammler/openssl.rar OpenSSL]
 +
* [http://freenet-homepage.de/inputsammler/groups.gz groups]
  
=== Samba ===
+
* Unrar it and transfer openssh-3.0.2p1.tar.gz and openssl-0.9.6e.tar.gz and groups.gz to the TeraStation by copying it to the share.
 +
* Untar both into the root directory of the TeraStation.
 +
* Untar groups.gz to /bin 
 +
* Edit /etc/rc.d/init.d/ssh and remove the # from line 14 which mentions AUTOKEYGEN.
 +
* The following commands make it automatically start on boot and also start now:
  
It is possible to modify the TeraStation's Samba install to properly map the System, Archive, Hidden, and Read-Only attributes for files (not directories). This modification will require you have Telnet access to your TeraStation as per the modifications previously mentioned.
+
  cd /etc/rc.d/rc3.d/
 +
  ln -s ../init.d/ssh S30ssh
 +
  /etc/rc.d/init.d/ssh start
  
The general approach is this. The /etc/samba/smb.conf file contains Samba's configuration settings. To map the attributes, we need to add the following to the global section or to the individual shares:
+
If you've done all the steps correctly then OpenSSH should be running and also start each time you reboot the TeraStation.
 +
The version of OpenSSH that was compiled for the Kuro Box actually has a security flaw which was corrected in newer versions of OpenSSH.
 +
And now you can Access from Windows too your Tera with Winscp and make Tunnel with Putty. You can trick some Firewall with Putty and Tunnel :-)
  
map hidden = yes
+
--[[User:Inputsammler|Inputsammler]] 00:41, 26 December 2006 (CET)
map archive = yes
+
map system = yes
+
create mode = 771
+
directory mode = 770
+
  
We also need to remove the "force create mode" and "force directory mode" entries.  Unfortunately, just modifying the file is not enough because every boot, a script calls /sbin/teractrl -k which overwrites the configuration file.  I noticed that most of the scripts also called /usr/local/bin/mkrsconf.pl afterwards to setup the rsync config for backup purposes, so I piggy back on that script to rewrite the Samba configuration.
+
What is OpenSSL needed for here? --[[User:Aspiers|Aspiers]] 14:52, 1 July 2007 (CEST)
  
Make a backup of your existing mkrsconf.pl file, and then replace the original with the new file content I have below.  If you're working in Windows, you can copy the file to one of the shares under /mnt/array1, just be sure to use a UNIX compatible text editor if you don't want your newlines to get messed up.  Then you can copy from there to the /usr/local/bin folder via Telnet to overwrite the original file.
+
=== Rsync ===
  
The other thing you'll need to do when you're done is update all of the attributes on your existing shares since previously everything was probably created with 777 permisions, which will result in all of your files now showing up as hidden, system files. You can change the permissions from Telnet using chmod, or you can do it from a Windows Command Prompt using the attrib command.
+
Using the Rsync protocol daemon is probably the fastest way to read or write data to the TeraStation, and is the method by which the TeraStation backs itself up to other TeraStations. It is in fact shipped with the stock firmware but restricted (usually to other known TeraStations).
 +
You have two options: (1) remove or alter the entry from /etc/hosts.deny, or (2) use an ssh tunnel (such as the one available through Dropbear).
 +
The first option exposes your TeraStation to anyone on the network. Also, you have to alter the file every time you boot, as the file is regenerated at boot time (For example, this can be done by invoking your generation script at the end of /usr/local/bin/mkrsconf.pl). The second option is much more secure, but the resources needed for the encryption end up reducing your file throughput significantly.  
  
Also of note, TeraStation generated files are created by "root", so with group permissions adjusted now you may not be able to modify attributes of files like backup logs.  It's probably not necessary though as you can still read/write the content, but if you need to, you can either take care of those from Telnet by doing a chown to change the owner, or you can modify the script to also add:
+
''Note:'' The rsync shipped with the stock firmware has a somewhat short maximum path length (seems to be around 160 characters), so you need to keep your directory tree shallow. Of course, you could always download the Rsync source and compile it with a larger maximum path length.  (Using 1.03, I didn't seem to have this problem with long path names. -- SteveK)
  
force group = root
+
=== Midnight Commander ===
force user = root
+
  
I haven't tested the latter scenario, but I understand it will force all content on disk to be owned by root and have all share access performed as root.  This isn't quite as bad as it sounds.  Check out this link for more information:
+
For a description on how to install, see [[Midnight Commander]].
http://www.oreilly.com/catalog/samba/chapter/book/ch05_03.html
+
  
Why these extremely useful features weren't on by default I don't know.  Here's a link to the modified file.  Be sure to rename it to mkrsconf.pl on your side!
+
=== Encryption, NTFS Support, and Windows Share Management ===
  
http://www.spicypixel.com/download/mkrsconf.pl.txt
+
[[User:Aaron|Aaron]] explains how he converted his TeraStation to an ETH-disk and
 +
gained [[Encryption, NTFS Support, and Windows Share Management]] by using an
 +
additional Windows system.
  
One word of caution, for most configurations I think I'm picking up all of the required entries from the system configuration files.  But, it's entirely possible you may have a configuration parameter that isn't currently read by the script.  If so, please note the discrepency, let me know so I can update it, and make sure you update your copy to pick up the extra parameter if you need to use it in the mean time.
+
=== Samba ===
  
Once you've replaced the file, just type "reboot" from the Telnet prompt and when your TeraStation comes back up, you should have the ability to change file attributes.  This will allow you to use real backup programs that make use of the Archive attribute for incremental backups.
+
See [[Samba]].
 
+
--[[User:Aaron|Aaron]] 23:58, 10 Mar 2006 (CET)
+
 
+
 
+
I have noticed the chown and chmod on the TS were not compiled with large file support, so if you may get something like the following if you try and change the permissions on a large file:
+
  # chown kimbotha:hdusers ./hdc-20060305.img.bz2
+
  chown: ./hdc-20060305.img.bz2: Value too large for defined data type
+
 
+
  # chmod g+w ./hdc-20060305.img.bz2
+
  chmod: ./hdc-20060305.img.bz2: Value too large for defined data type
+
Luckily, perl is compiled with large file support so some equivalent commands would be:
+
  # perl -e 'chown 1002, 100, "hdc-20060305.img.bz2";'
+
 
+
  # perl -e 'chmod 0775, "hdc-20060305.img.bz2";'
+
 
+
-- [[User:Kimbotha|Kimbotha]] 11:21, 26 October 2006 (CEST)
+
  
 
=== NFS ===
 
=== NFS ===
  
OK, [http://www.sf-bay.org/~scott/all-nfsd.tar.gz].  This contains the kernel
+
See [[NFS]].
modules, the utilities and the startup files for kernel NFS.
+
  
Then, because the symlink that is /var gets overwritten:
+
=== Lundman page ===
  
cp -a /var/lib /mnt/ram/var/lib
+
Alternative Media Server and FTPD. [http://www.lundman.net/wiki/index.php/TeraStation home page]
mv /var /var.old
+
ln -s /mnt/ram/var /var
+
  
Edit /etc/exports
+
[http://www.lundman.net/ftp/llink/llink-ts-b258.tgz llink] 861k.
to match your setup, then reboot or run the init files by hand:
+
  
depmod -a
+
[http://www.lundman.net/ftp/lundftpd/lundftpd-ts-3.06.tgz lundftpd] 1.2m.
/etc/init.d/portmap start
+
/etc/init.d/nfs-common start
+
/etc/init.d/nfs-kernel-server start
+
  
 +
--[[User:Scott|Scott]] 19:09, 18 Aug 2005 (CEST)
  
==== Warning ====
+
=== Joe 3.2 a good fast editor ===
  
Problems with NFS may arise, please see the discussion page for details.
+
Download [http://freenet-homepage.de/inputsammler/joe-3.2.tgz JOE-3.2] and untar into the root directory and run it with the command
 +
  joe
 +
Example:
 +
  joe /etc/rc.d/init.d/ssh
 +
The hotkey for help ist
 +
  STRG+K+H
 +
--[[User:Inputsammler|Inputsammler]] 00:41, 26 December 2006 (CET)
  
Having just spent several days trying to get NFS working I can give a few tips.  If you can write to the NFS share, but have problems reading from it (transfers stall or terastation randomly reboots) try disabling jumbo packets.  If the jumbo packet size on all your machines doesn't match than UDP transfers such as NFS wreak havoc with the terastation. I now have the 2.03 firmware and user mode NFS (from debian PPC) working smoothly. An alternative solution would be to use TCP rather than UDP for NFS, but not all NFS implementations support this.
+
There's another link for Joe 3.2 [http://homepage.ntlworld.com/itimpi/buffalo.htm#PACKAGES here] which points to [http://downloads.linkstationwiki.net/ALL_PPC/joe-3.2-ppc.tgz here].
  
==== Notes ====
+
=== Webmin installation on Terastation ===
 
+
Missing rpcinfo? After installing nfsd_terastation.tgz "tar -C / -xzf nfsd_terastation.tgz" the initialization script "/etc/init.d/nfsd-kernel-server" references "rpcinfo" and fails to start rpc.mountd because rpcinfo is missing and the parameters for rpc.mountd are wrong.
+
 
+
Edit the nfsd-kernel-server file and set the option on line 22 to:
+
 
+
RPCMOUNTDOPTS="--no-nfs-version"
+
or
+
RPCMOUNTDOPTS="--nfs-version" 
+
 
+
Note line 39-40.  It uses RPCMOUNTDOPTS to build an options line for rpc.mountd.  Simply put on line 22 RPCMOUNTDOPTS="--nfs-version" and when you start the server, it will run "rpc.mountd --nfs-version 3".
+
+
If you get a "Permission Denied" when trying to mount an export, check to see that the reverse DNS entry resolves correctly for the server trying to mount.  On the terastation, update your /etc/hosts file (optional) and create a script to reset this file every time the server boots.  /etc/rc.d/init.d/networking overwrites this file.
+
 
+
I put in "--nfs-version 3" as I only want v3 support. I am still testing this. -- [[User:Kimbotha|Kimbotha]] 10:45, 26 October 2006 (CEST)
+
 
+
--status:  Please note that I have personally had a HUGE problem with the NFS CLIENTS when using this server.  There seems to be a large degree of "retransmissions" and I/O problems as a result of communicating with the nfs server.  (Run "nfsstat" on the client). If there has been any updates to the server, I'd wish they would be published!  Perhaps I'll just fall back to using "smbmount" Also, this server appears to have only UDP support.  NFS Clients complain with "nfs over UDP causes data corruption" (ick).
+
-- 12:00, November 24 2006 (SGT)
+
 
+
--note: can anyone translate japanese? This might be some pertinent information. I am also trying to get NFS working well.
+
http://blog.livedoor.jp/nano_j/archives/50498734.html --[[User:Brent|Brent]] 04:23, 3 December 2006 (CET)
+
 
+
== Lundman page ==
+
 
+
Alternative Media Server and FTPD. [http://www.lundman.net/wiki/index.php/TeraStation home page]
+
 
+
[http://www.lundman.net/ftp/llink/llink-ts-b258.tgz llink] 861k.
+
 
+
[http://www.lundman.net/ftp/lundftpd/lundftpd-ts-3.06.tgz lundftpd] 1.2m.
+
 
+
 
+
--[[User:Scott|Scott]] 19:09, 18 Aug 2005 (CEST)
+
  
 +
I just managed to install [http://www.webmin.com/ Webmin] on my Terastation.  It was pretty simple, really.  Just download the GZIP, unzip/untar into /root then run "./setup.sh /usr/local/webmin".  I found it needed to go into /root to make some of the perl scripts to work.  The only thing I had to change from the default was the location of PERL.  It installs itself as another web server (<your terastation address>:10000).  I'm still having a bit of trouble getting it to restart after a reboot, but once it is running you can look around in your system, adjust Samba settings, look at printers, log files, cron files, etc.
  
 
== Minimalistic changes to firmware with SSH only (also includes step by step process) ==
 
== Minimalistic changes to firmware with SSH only (also includes step by step process) ==
Line 260: Line 173:
 
--[[User:kevin|kevin]]
 
--[[User:kevin|kevin]]
  
 +
== Compiling software for the Terastation ==
  
== Create your own Terastation cross toolchain ==
+
See [[Compilation]].
Note:  If you want a nice structured build environment, try the [http://www.terastation.org/wiki/Hacking#Using_a_3rd_party_Cross_Toolchain ELDK] instead.
+
  
# Get prepared with the appropriate files:
+
== Success reports ==
#* [http://kegel.com/crosstool/crosstool-0.42.tar.gz Crosstool v. 0.42] [http://kegel.com/crosstool Crosstool Website].  Extract this to a working location.
+
#* [http://downloads.linkstationwiki.net/cross-toolchains/configs/powerpc-hdhglan.config A kernel config file] from the [http://www.linkstationwiki.net Linkstation Wiki] site.  Put this file in the crosstools directory.
+
# Create a powerpc-603e.dat file in the crosstools directory:
+
#: KERNELCONFIG=`pwd`/powerpc-603e.config
+
#: TARGET=powerpc-603e-linux-gnu
+
#: TARGET_CFLAGS="-O -mcpu=603e"
+
#: GCC_EXTRA_CONFIG="--with-cpu=603e --enable-cxx-flags=-mcpu=603e"
+
# Create a build shell script in the crosstools directory:
+
#: #!/bin/sh</code>
+
#: set -ex</code>
+
#: TARBALLS_DIR=/tmp/downloads
+
#: RESULT_TOP=/opt/crosstool
+
#: export TARBALLS_DIR RESULT_TOP
+
#: #GCC_LANGUAGES="c,c++,java"
+
#: GCC_LANGUAGES="c,c++"
+
#: export GCC_LANGUAGES
+
#:
+
#: # Really, you should do the mkdir before running this,
+
#: # and chown /opt/crosstool to yourself so you don't need to run as root.
+
#: # mkdir -p $RESULT_TOP
+
#:
+
#: # Build the toolchain.  Takes a couple hours and a couple gigabytes.
+
#:  eval `cat powerpc-603e.dat gcc-3.3.6-glibc-2.3.2.dat`  sh all.sh --notest
+
#:
+
#: echo Done.
+
#:
+
#:A couple of things to note here.  The Terastation stock gcc/glibc is 3.3.1/2.3.2.  The gcc crossbuild #:of 3.3.1 requires a couple of extra patches to compile and 3.3.6 compiles cleanly.  It's unlikely #:that something would specifically require 3.3.1 so I used 3.3.6.
+
#:
+
#:Also, note that the java language is not built.  It does not compile without error in the crossbuild.  #:It's probably trivial to get it to compile, I just quit trying because I don't currently have a use #:for it.  If you get it to compile, please post the patch here.
+
  
# Start the Build
+
This is an old list of people reporting success with some of the above hacks.
#:First create the /opt/crosstools directory and make sure your compiling user (hopefully not root) has #:access to write files there, then:
+
If you are successful (or not) with any of them, or want to add any other comments about them, please do '''not''' add to this list - instead, '''please add a comment under the relevant section'''That way, people can see all the comments about ssh in one place, all the comments about NFS in another, and so on - makes for a much better structured wikiThanks!
#:: ./powerpc-603e.sh
+
#:
+
#:(Go have a beer, or sixThis will take awhile.  On my 1.4 GHz machine, it takes roughly 4 hours #:(hey, just be happy you're not building it on your wimpy TS)It will use about 2 GB of disk space #:as well.)
+
  
--[[User:Entropy|Entropy]] 10:08, 30 November 2006 (CET)
+
#[[User:Bluefedora|Bluefedora]], 1.12, 2005-11-18
 
+
#* added dropbear as outlined below
== Using a 3rd party Cross Toolchain ==
+
# Jones, 1.12, 2005-10-11
Recently, I've been using the [http://www.denx.de/wiki/DULG/ELDK Embedded Linux Development Kit] toolchain from [http://www.denx.de Denx Software Engineering].  This is a FREE cross-platform toolchain with support for a number of target CPUs (including the PPC 603e in the Terastation). The complete system is managed by [http://www.rpm.org RPM], including the cross-build process.  The base toolchain comes with [http://www.denx.de/wiki/view/DULG/ELDKPackages#Section_3.8.2. quite a few "ready to install" RPMs for your target platform].
+
#* Hacking with SSH and SAMBA 3.0.14a (Debian package).
 
+
#* Now I am shooting on the problem of led (STATUS/FULL) not working properly.
I'm using the [http://mirror.switch.ch/ftp/mirror/eldk/eldk/3.1.1-2005-06-07/ 3.1.1-2005-06-07 version] as it most closely matches the libraries already on the Terastation.
+
# yukiman, 1.12, 2005-12-03
 
+
#* Used Dave's firmware with 1.12 installed and update worked fine, logged in now via telnet.
{| border="1" cellpadding="2"
+
#* Got dropbear working as well.
! Package / Platform !! Terastation Pro !! ELDK 3.1.1-2005-06-07
+
# [[User:mh123083|mh123083]], 1.12, 2006-01-13
|-
+
#* Used Dave's firmware with dropbear and allnfs - works perfectly.
! gcc
+
# [[User:alun|alun]], 1.12, 2006-01-19
| 3.3.1 || 3.3.3
+
#* Used Dave's firmware. Updated from (factory) 1.08. Have not installed anything else yet. Worried about possible nfs problems...
|-
+
# [[User:SKarp|SKarp]] 18:38, 2 Feb 2006 (CET)
! glibc
+
#* Updated from stock 1.03 to Dave's firmware 1.12 and added allnfs.  Working fine in early testing.
| 2.3.2 || 2.3.1
+
# [[User:raphael|Raphaël]] 22:55, 24 Mar 2006 (JST)
|}
+
#* Updated from 2.03 to Dave's 2.03, works fine.
--[[User:Entropy|Entropy]] 10:50, 6 December 2006 (CET)
+
#* 2.05a didn't work and left my box flat, but an upgrade to 2.03 afterwards restored the situation.
 
+
# poxy bowsy 9 April 2006
 
+
#* Updated from 1.12 to Dave's 2.05a, but install failed, unit was EM'ed
== Open SSL and Open SSH and use Winscp (Putty) to Access with Windows ==
+
#* reinitialized and tried to revert to 1.12a but unit was still EM'ed
 
+
#* reinitialized and tried to revert to stock 1.12 but unit was still EM'ed
Download [http://winscp.net/ WinScp] and [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty]
+
#* reinitialized and installed 2.05a again and everything seems fine (whew)
Download [http://freenet-homepage.de/inputsammler/openssh-3.0.2p1.tar.gz Openssh]and [http://freenet-homepage.de/inputsammler/openssl.rar Open SSL ] and [http://freenet-homepage.de/inputsammler/groups.gz grops]
+
# [[Ringgh0st]], 1.12 2006-04-10
 
+
#* upgraded to Dave's hacked Firmware v1.12 on a v1.12 Terastation
 
+
#* added Midnight Commander (starts with a little codepage fault, but notthing really important)
* Unrar it and transfer openssh-3.0.2p1.tar.gz and openssl-0.9.6e.tar.gz and groups.gz to the TeraStation by copying it to the share.
+
#* didnt get the lundftpd working yet, the service doesnt start (no errorlog), if i try to start it manually with the -v string a "segmentation fault" pops up
* Untar both into the root directory of the TeraStation.
+
# torbens
* Untar groups.gz to /bin 
+
#* 27 April 2006: 1st station updated to Dave's v2.08a using Japanese firmware updater
* Edit /etc/rc.d/init.d/ssh and remove the # from line 14 which mentions AUTOKEYGEN.  
+
#* 29 April 2006: 2nd station updated to Dave's v2.08a using Japanese firmware updater (had to use recovery with powerbutton on diag.)
* The following commands make it automatically start on boot and also start now:
+
#* 1 Juli 2006: 3rd station pro updates to Dave's v1.03 using Japanese firmware updater
 
+
# Risse-it 02.05.2006
  cd /etc/rc.d/rc3.d/
+
#* Updated TS0.6GB from 1.12 to minimalistic (ssh only)
  ln -s ../init.d/ssh S30ssh
+
#* didn't reboot after installing MC and disc-tuning via hdparm (don't know which was the problem - i did both)
  /etc/rc.d/init.d/ssh start
+
#* restored by mounting the first IDE-drive to my Gentoo-x86 (xfs_repair -L) and copied the imagefiles from minimalistic
 
+
#* hdparm now runs with -d1 -c1 -m16 -a64 -A1 -u1 -k1 -S241 (any suggestions?)
 
+
#* patched some .cgi and .pl-files for more statistics (anyone who's running rrdtool or any other statistics???)
If you've done all the steps correctly then OpenSSH should be running and also start each time you reboot the TeraStation.
+
#* USB-printer will only print from Windows (VMware) and not via smb from Gentoo or Ubuntu (Epson Stylus Color C82)
The version of OpenSSH that was compiled for the Kuro Box actually has a security flaw which was corrected in newer versions of OpenSSH.
+
#* patched mail-notifier (to do smtp-auth)
And now you can Access from Windows too your Tera with Winscp and make Tunnel with Putty. You can trick some Firewall with Putty and Tunnel :-)
+
# Entropy 2006-May-20
 
+
#* [http://www.megaupload.com/?d=G6269VIG Updated Terastation Pro firmware] 1.01 with dropbear and nfs user space daemons
--[[User:Inputsammler|Inputsammler]] 00:41, 26 December 2006 (CET)
+
#* [http://www.terastation.org/wiki/TeraStationPro#Non-Official_Firmware Test Firmware] 1.01 with openssh, nfs v3, etc.
 
+
# --[[User:Luminaire|Luminaire]] 11:14, 31 May 2006 (CEST)
 
+
#* Used successfully on TS HD-H1.0TGL/R5 (1.12 firmware).  Works a treat.  Going to try NFS/NIS.
== Joe 3.2 a good fast editor ==
+
Used successfully on TS-1.0TGL/R5 Works but damn is this thing slow. Truly bound by pathetic CPU.  Doesn't even begin to test the Gigabit network
 
+
# -- [[User:Kimbotha|Kimbotha]] 14:57, 25 October 2006 (CEST)
Download [http://freenet-homepage.de/inputsammler/joe-3.2.tgz JOE-3.2] and untar into the root directory and run it with the command
+
#* 24 October 2006: Updated new 1TB Terastation from v1.12 to Dave's v2.10a - Failed first time, reapplied v2.10a and it nows works fine.
  joe
+
#* Installed dropbear following instructions successfully
Example:
+
#* Tried to install kernel mode nfs as per instructions but failed to load modules
  joe /etc/rc.d/init.d/ssh
+
#* installed user mode nfs as per Entropy's instructions successfully
The hotkey for help ist
+
#* currently looking to build a cross toolchain so I can build unfs3 as I need >2GB file support
  STRG+K+H
+
# -- [[User:Kimbotha|Kimbotha]] 16:37, 25 October 2006 (CEST)
--[[User:Inputsammler|Inputsammler]] 00:41, 26 December 2006 (CET)
+
#* While collecting the components to try and start build a cross compile toolchain I found an set of nfs kernel modules and the nfs kernel daemon here (http://downloads.linkstationwiki.net/terastation/kernel_modules/). These seem to load fine on my TS (with a change to the /etc/init.d/nfs-kernel-server to allow rpc.mountd to start). Will try and run some tests on >2GB files when I have some on there to work with.

Latest revision as of 09:44, 11 November 2007


N.B. There is also some potentially useful information in the discussion page corresponding to this article, which needs refactoring. If you would like to add to the wiki, please first think which bit of which page is the most appropriate home for your contribution - thanks!

Contents

Hardware Hacking

Firmware Hacking

You can create your own firmware, it's explained here.

Already hacked firmware

Dave Walker created a hacked firmware that you can just download and use (Thank you Dave!):

Software for the TeraStation

I will add small software packages as .tgz here for you to install onto the TeraStation.

As a rule, you should be able to use most Debian PowerPC packages built for woody. Use ftp to access ftp.de.debian.org (or another mirror), go to pub/debian/pool/main/ and to the directory named with the first letter of what you are looking for, there you should find a directory for the package; download a suitable version (should have "woody" and "powerpc" in the name), unpack it on a Debian box using "dpkg-deb -x package.deb name-of-temporary-dir", remove any clutter (man pages) from your temporary directory, create a tar file and copy it over to the TeraStation.

(NB I wanted to upload a .tgz but the Wiki didn't let me, saying that .tgz was not an accepted image format. --Fred 12:05, 12 Dec 2005 (CET))


Dropbear sshd

A small ssh server. home page

The install package (108k) already contains the proper links to have it start on boot, and it contains two keys for the server. Maybe you want to generate your own set of keys.

Just extract the .tgz as root into the root of your TeraStation:

dmin@HD-HTGL113:~$ sudo -s
Password:
root@HD-HTGL113:~# cd /
root@HD-HTGL113:/# tar -xzf /mnt/array1/share/dropbear.tgz

generate your own set of keys:

root@HD-HTGL113:/# rm /etc/dropbear/dropbear_rsa_host_key
root@HD-HTGL113:/# rm /etc/dropbear/dropbear_dss_host_key
root@HD-HTGL113:/# dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
Will output 1024 bit rsa secret key to '/etc/dropbear/dropbear_rsa_host_key'
Generating key, this may take a while...
Public key portion is:
...
root@HD-HTGL113:/# dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
Will output 1024 bit dss secret key to '/etc/dropbear/dropbear_dss_host_key'
Generating key, this may take a while...
Public key portion is: 
...

and reboot.


Can I setup public key authentication on dropbear. If so can someone give me an example. I was able to upgrade the firmware successfully on the Terastation Pro. I am planning to do a Public Key Authentication on my mac and use rsync for backup using ssh protocol. Any ideas? Thanks a gazillion, Naven

Yes you can: Create a key on your Linux/Unix workstation with: ssh-keygen -t rsa The public and private key will be automatically saved to the directory .ssh in your homedir.

Next: copy the text from id_rsa.pub and connect to your Terastation as root.

On your Terastation: - mkdir /root/.ssh - vi /root/.ssh/authorized_keys - paste the text you copied in the step before - save the file

Now you can connect to your Terastation by using public key authentication

OpenSSH

Here's a Terastation version.

OpenSSL and OpenSSH and using Winscp (Putty) to Access with Windows

Download:

  • Unrar it and transfer openssh-3.0.2p1.tar.gz and openssl-0.9.6e.tar.gz and groups.gz to the TeraStation by copying it to the share.
  • Untar both into the root directory of the TeraStation.
  • Untar groups.gz to /bin
  • Edit /etc/rc.d/init.d/ssh and remove the # from line 14 which mentions AUTOKEYGEN.
  • The following commands make it automatically start on boot and also start now:
  cd /etc/rc.d/rc3.d/
  ln -s ../init.d/ssh S30ssh
  /etc/rc.d/init.d/ssh start

If you've done all the steps correctly then OpenSSH should be running and also start each time you reboot the TeraStation. The version of OpenSSH that was compiled for the Kuro Box actually has a security flaw which was corrected in newer versions of OpenSSH. And now you can Access from Windows too your Tera with Winscp and make Tunnel with Putty. You can trick some Firewall with Putty and Tunnel :-)

--Inputsammler 00:41, 26 December 2006 (CET)

What is OpenSSL needed for here? --Aspiers 14:52, 1 July 2007 (CEST)

Rsync

Using the Rsync protocol daemon is probably the fastest way to read or write data to the TeraStation, and is the method by which the TeraStation backs itself up to other TeraStations. It is in fact shipped with the stock firmware but restricted (usually to other known TeraStations). You have two options: (1) remove or alter the entry from /etc/hosts.deny, or (2) use an ssh tunnel (such as the one available through Dropbear). The first option exposes your TeraStation to anyone on the network. Also, you have to alter the file every time you boot, as the file is regenerated at boot time (For example, this can be done by invoking your generation script at the end of /usr/local/bin/mkrsconf.pl). The second option is much more secure, but the resources needed for the encryption end up reducing your file throughput significantly.

Note: The rsync shipped with the stock firmware has a somewhat short maximum path length (seems to be around 160 characters), so you need to keep your directory tree shallow. Of course, you could always download the Rsync source and compile it with a larger maximum path length. (Using 1.03, I didn't seem to have this problem with long path names. -- SteveK)

Midnight Commander

For a description on how to install, see Midnight Commander.

Encryption, NTFS Support, and Windows Share Management

Aaron explains how he converted his TeraStation to an ETH-disk and gained Encryption, NTFS Support, and Windows Share Management by using an additional Windows system.

Samba

See Samba.

NFS

See NFS.

Lundman page

Alternative Media Server and FTPD. home page

llink 861k.

lundftpd 1.2m.

--Scott 19:09, 18 Aug 2005 (CEST)

Joe 3.2 a good fast editor

Download JOE-3.2 and untar into the root directory and run it with the command

  joe

Example:

  joe /etc/rc.d/init.d/ssh

The hotkey for help ist

  STRG+K+H

--Inputsammler 00:41, 26 December 2006 (CET)

There's another link for Joe 3.2 here which points to here.

Webmin installation on Terastation

I just managed to install Webmin on my Terastation. It was pretty simple, really. Just download the GZIP, unzip/untar into /root then run "./setup.sh /usr/local/webmin". I found it needed to go into /root to make some of the perl scripts to work. The only thing I had to change from the default was the location of PERL. It installs itself as another web server (<your terastation address>:10000). I'm still having a bit of trouble getting it to restart after a reboot, but once it is running you can look around in your system, adjust Samba settings, look at printers, log files, cron files, etc.

Minimalistic changes to firmware with SSH only (also includes step by step process)

Minimalistic ready-to use firmware update with step-by-step guide. All credits to the authors of this wiki.

[1] Blog post with image.

--kevin

Compiling software for the Terastation

See Compilation.

Success reports

This is an old list of people reporting success with some of the above hacks. If you are successful (or not) with any of them, or want to add any other comments about them, please do not add to this list - instead, please add a comment under the relevant section. That way, people can see all the comments about ssh in one place, all the comments about NFS in another, and so on - makes for a much better structured wiki. Thanks!

  1. Bluefedora, 1.12, 2005-11-18
    • added dropbear as outlined below
  2. Jones, 1.12, 2005-10-11
    • Hacking with SSH and SAMBA 3.0.14a (Debian package).
    • Now I am shooting on the problem of led (STATUS/FULL) not working properly.
  3. yukiman, 1.12, 2005-12-03
    • Used Dave's firmware with 1.12 installed and update worked fine, logged in now via telnet.
    • Got dropbear working as well.
  4. mh123083, 1.12, 2006-01-13
    • Used Dave's firmware with dropbear and allnfs - works perfectly.
  5. alun, 1.12, 2006-01-19
    • Used Dave's firmware. Updated from (factory) 1.08. Have not installed anything else yet. Worried about possible nfs problems...
  6. SKarp 18:38, 2 Feb 2006 (CET)
    • Updated from stock 1.03 to Dave's firmware 1.12 and added allnfs. Working fine in early testing.
  7. Raphaël 22:55, 24 Mar 2006 (JST)
    • Updated from 2.03 to Dave's 2.03, works fine.
    • 2.05a didn't work and left my box flat, but an upgrade to 2.03 afterwards restored the situation.
  8. poxy bowsy 9 April 2006
    • Updated from 1.12 to Dave's 2.05a, but install failed, unit was EM'ed
    • reinitialized and tried to revert to 1.12a but unit was still EM'ed
    • reinitialized and tried to revert to stock 1.12 but unit was still EM'ed
    • reinitialized and installed 2.05a again and everything seems fine (whew)
  9. Ringgh0st, 1.12 2006-04-10
    • upgraded to Dave's hacked Firmware v1.12 on a v1.12 Terastation
    • added Midnight Commander (starts with a little codepage fault, but notthing really important)
    • didnt get the lundftpd working yet, the service doesnt start (no errorlog), if i try to start it manually with the -v string a "segmentation fault" pops up
  10. torbens
    • 27 April 2006: 1st station updated to Dave's v2.08a using Japanese firmware updater
    • 29 April 2006: 2nd station updated to Dave's v2.08a using Japanese firmware updater (had to use recovery with powerbutton on diag.)
    • 1 Juli 2006: 3rd station pro updates to Dave's v1.03 using Japanese firmware updater
  11. Risse-it 02.05.2006
    • Updated TS0.6GB from 1.12 to minimalistic (ssh only)
    • didn't reboot after installing MC and disc-tuning via hdparm (don't know which was the problem - i did both)
    • restored by mounting the first IDE-drive to my Gentoo-x86 (xfs_repair -L) and copied the imagefiles from minimalistic
    • hdparm now runs with -d1 -c1 -m16 -a64 -A1 -u1 -k1 -S241 (any suggestions?)
    • patched some .cgi and .pl-files for more statistics (anyone who's running rrdtool or any other statistics???)
    • USB-printer will only print from Windows (VMware) and not via smb from Gentoo or Ubuntu (Epson Stylus Color C82)
    • patched mail-notifier (to do smtp-auth)
  12. Entropy 2006-May-20
  13. --Luminaire 11:14, 31 May 2006 (CEST)
    • Used successfully on TS HD-H1.0TGL/R5 (1.12 firmware). Works a treat. Going to try NFS/NIS.

Used successfully on TS-1.0TGL/R5 Works but damn is this thing slow. Truly bound by pathetic CPU. Doesn't even begin to test the Gigabit network

  1. -- Kimbotha 14:57, 25 October 2006 (CEST)
    • 24 October 2006: Updated new 1TB Terastation from v1.12 to Dave's v2.10a - Failed first time, reapplied v2.10a and it nows works fine.
    • Installed dropbear following instructions successfully
    • Tried to install kernel mode nfs as per instructions but failed to load modules
    • installed user mode nfs as per Entropy's instructions successfully
    • currently looking to build a cross toolchain so I can build unfs3 as I need >2GB file support
  2. -- Kimbotha 16:37, 25 October 2006 (CEST)
    • While collecting the components to try and start build a cross compile toolchain I found an set of nfs kernel modules and the nfs kernel daemon here (http://downloads.linkstationwiki.net/terastation/kernel_modules/). These seem to load fine on my TS (with a change to the /etc/init.d/nfs-kernel-server to allow rpc.mountd to start). Will try and run some tests on >2GB files when I have some on there to work with.