Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Mon Nov 20, 2017 1:02 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Tue Jan 11, 2011 5:30 pm 
Offline
Total Newbie

Joined: Tue Jan 11, 2011 5:12 pm
Posts: 1
Code:
User@PC:~/>mkdir terastation
User@PC:~/terastation/>cd terastation
User@PC:~/terastation/>wget http://downloads.buffalo.nas-central.org/TOOLS/ALL_LS_KB_ARM9/ACP_COMMANDER/acp_commander.jar
User@PC:~/terastation/>java -jar acp_commander.jar -t $IP -c "/usr/sbin/telnetd" -ip $IP

login as admin in telnet
Code:
User@PC:~/terastation/>telnet $IP

plug on terastation a usb drive, now the file /etc/cron/crontabs/root is writable
Code:
-sh-3.2$vi /etc/cron/crontabs/root

add line:
Code:
$MM $HH * * * /home/prueba.sh
and !wq
Note: Caution with the time
Code:
-sh-3.2$vi /home/prueba.sh

Add:
Code:
    #!/bin/sh
    chmod 777 /etc/shadow
    echo "Nice" > /home/prueba.log

Code:
-sh-3.2$ chmod +x /home/prueba.sh 

-sh-3.2$exit

Reboot the terastation in the web interface

Code:
User@PC:~/terastation/>java -jar acp_commander.jar -t $IP -c "/usr/sbin/telnetd" -ip $IP
User@PC:~/terastation/>login as admin in telnet

wait the time what your put in crontab
Code:
-sh-3.2$cp /etc/shadow /home/shadow.bak
-sh-3.2$vi /etc/shadow
copy your admin pass (admin:$COPYTHIS:12345:0:99999:7:::) and replace in the root user, now you have the root pass.
Code:
-sh-3.2$chmod 644 /etc/shadow
-sh-3.2$exit
login as root in telnet
Code:
User@PC:~/terastation/>telnet $IP
root@$TERASTATION:~#cp /etc/init.d/sshd.sh /home/sshd.sh.bak
root@$TERASTATION:~#vi /etc/init.d/sshd.sh
*Edit all file with:*
Code:
#! /bin/sh
  #
  # Start/stop the SSH daemon.
  #
  test -f /usr/local/sbin/sshd || exit 0
  # this is used by daemonwatch (since fw 1.11-1a) 
  ACTIVE_FILE=/var/run/active_sshd
  case "$1" in
  start)
        echo "Start service: sshd"
        /usr/local/sbin/sshd -f /etc/sshd_config
        touch ${ACTIVE_FILE}
        ;;
        stop)
             echo "Stop service: sshd"
             killall sshd
             rm -f ${ACTIVE_FILE}
        ;;
        restart)
             $0 stop
             $0 start
                ;;
       *)
        echo "Usage: $0 start|stop|restart"
        exit 1
          ;;
  esac
  exit 0


Code:
root@$TERASTATION:~#cp /etc/init.d/sshd.sh /home/sshd.sh.bak
root@$TERASTATION:~#vi /etc/sshd_config
*Edit all file with:*
Code:
#       $OpenBSD: sshd_config,v 1.65 2003/08/28 12:54:34 markus Exp $
 
  # This is the sshd server system-wide configuration file.  See
  # sshd_config(5) for more information.

  # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

  # The strategy used for options in the default sshd_config shipped with
  # OpenSSH is to specify options with their default value where
  # possible, but leave them commented.  Uncommented options change a
  # default value.

  Port 22
  Protocol 2,1
  #ListenAddress 0.0.0.0
  #ListenAddress ::

  # HostKey for protocol version 1
  HostKey /etc/ssh_host_key
  # HostKeys for protocol version 2
  #HostKey /etc/ssh_host_rsa_key
  #HostKey /etc/ssh_host_dsa_key
  #HostKey /etc/apache/server.key

  # Lifetime and size of ephemeral version 1 server key
  #KeyRegenerationInterval 1h
  #ServerKeyBits 768

  # Logging
  #obsoletes QuietMode and FascistLogging
  #SyslogFacility AUTH
  #LogLevel INFO

  # Authentication:

  #LoginGraceTime 2m
  #PermitRootLogin yes
  PermitRootLogin yes
  StrictModes yes

  #RSAAuthentication yes
  #PubkeyAuthentication yes
  #AuthorizedKeysFile     .ssh/authorized_keys

  # For this to work you will also need host keys in /etc/ssh_known_hosts
  #RhostsRSAAuthentication no
  # similar for protocol version 2
  #HostbasedAuthentication no
  # Change to yes if you don't trust ~/.ssh/known_hosts for
  # RhostsRSAAuthentication and HostbasedAuthentication
  #IgnoreUserKnownHosts no                                                       
  # Don't read the user's ~/.rhosts and ~/.shosts files                         
  #IgnoreRhosts yes                                                             
                                                                                 
  # To disable tunneled clear text passwords, change to no here!         
  #PasswordAuthentication yes                                           
  #PermitEmptyPasswords no                                               
                                                                         
  # Change to no to disable s/key passwords                             
  #ChallengeResponseAuthentication yes                                   
                                                                         
  # Kerberos options                                                     
  #KerberosAuthentication no                                             
  #KerberosOrLocalPasswd yes                                             
  #KerberosTicketCleanup yes                                             
                                                                         
  # GSSAPI options                                                       
  #GSSAPIAuthentication no                                               
  #GSSAPICleanupCreds yes                                               
                                                                         
  # Set this to 'yes' to enable PAM authentication (via challenge-response)
  # and session processing. Depending on your PAM configuration, this may 
  # bypass the setting of 'PasswordAuthentication'                         
  UsePAM no                                                               
                                                                           
  #AllowTcpForwarding yes                                                 
  #GatewayPorts no                                                         
  #X11Forwarding no                                                       
  #X11DisplayOffset 10                                                     
  #X11UseLocalhost yes                                                     
  #PrintMotd yes                                                           
  #PrintLastLog yes                                                       
  #KeepAlive yes                                                           
  #UseLogin no                                                             
  #UsePrivilegeSeparation yes                                             
  PermitUserEnvironment yes                                               
  #Compression yes                                                         
  #ClientAliveInterval 0                                                   
  #ClientAliveCountMax 3                                                   
  #UseDNS yes                                                             
  #PidFile /var/run/sshd.pid                                               
  #MaxStartups 10                                                         
                                                                           
  # no default banner path                                                 
  #Banner /some/path                                                       
                                                                           
  # override default of no subsystems                                     
  Subsystem       sftp    /usr/local/libexec/sftp-server   


Code:
root@$TERASTATION:~#/etc/init.d/sshd.sh restart
root@$TERASTATION:~#vi /etc/cron/crontabs/root

deleted line:
Code:
$MM $HH * * * /home/prueba.sh


glossary:
Code:
$IP = Ip of your terastation
$MM = Minute 00-59
$HH = Hour 00-23
$TERASTATION = Name of your terastation


Top
   
PostPosted: Sun Jan 16, 2011 8:52 am 
Offline
Total Newbie

Joined: Sun Jan 16, 2011 8:25 am
Posts: 1
Great!! This Hack is what I was looking for and it did work for me (Terastation III XL - TS-XL1AE).
I needed it to fix the nfs service in order to use the terastation from a a linux server.
having root access, I suceeded in modifying the /etc/exports file.
However, when I mount the nfs share from the linux server, chmod does not work, even though the user/group stuff is ok.
the "chmod +x <file>" command from the linux server executes without error, but the file permissions remain unchanged (rw instead of rwx).
Is it possible that the nfs deamon (unfsd) running on the terastation is a "modified" version that ignores the "chmod" command?
Is anyone having the same issue and found a solution?

Without the possibility to set a file as "executable" the terastation is unusable from a linux system!

Thanks in advance to anyone who can help me to make this box usable.

Andrea


Top
   
PostPosted: Sun Jan 23, 2011 11:36 am 
Offline
Total Newbie

Joined: Sun Jan 23, 2011 11:06 am
Posts: 1
liberado

This is just want I wanted but without the SSH access so I could install Twonky onto the Box. Hence just after root password.

Manged to follow instructions (nice and detailed) prueba.log has "NICE" in it and the shadow file was writable. All commands worked a treat down to:-

Code:
-sh-3.2$chmod 644 /etc/shadow

Received an "operation not allowed" error.

Then I try TELNET and login as "root" the passwd does not seem to have changed, I still cannot get in. What am I doing wrong!!

When I copied the Password from admin to root I only replace where you had COPYTHIS
Quote:
(admin:$COPYTHIS:12345:0:99999:7:::)
Should I have replaced the whole string including the numbers?
When does The OS look at shadow file?

I feel I am very close and with you help might be able to complete this. Its driving me mad !!


Top
   
PostPosted: Fri Jan 28, 2011 10:21 am 
Offline
Total Newbie

Joined: Fri Jan 28, 2011 10:16 am
Posts: 4
Hello,

doesn't work for me :(.
Once I plug a usb key /etc/cron/crontabs/root remains read-only.

Please help!!!!

I have a TS-XE8.0TL/R5-E with firmware v. 1.50.

Thank you.
Thomas


Top
   
PostPosted: Mon Mar 07, 2011 1:22 am 
Offline
Newbie

Joined: Tue Jan 27, 2009 5:42 pm
Posts: 6
Dude your a ROCK STAR! :up: Works great.

I also tried a USB key and that did not work.

I unplugged all use devices rebooted the TSIII and then plugged in a usb drive (NOT A KEY) according to the steps and it worked great.


Top
   
PostPosted: Fri Mar 11, 2011 9:40 am 
Offline
Total Newbie

Joined: Fri Jan 28, 2011 10:16 am
Posts: 4
chris0583 wrote:
Dude your a ROCK STAR! :up: Works great.

I also tried a USB key and that did not work.

I unplugged all use devices rebooted the TSIII and then plugged in a usb drive (NOT A KEY) according to the steps and it worked great.


Hi Chris,

ok, I'm gonna try with a USB drive... but what do you mean with "unplugged all use devices" ?

Thx


Top
   
PostPosted: Fri Mar 11, 2011 6:13 pm 
Offline
Total Newbie

Joined: Fri Jan 28, 2011 10:16 am
Posts: 4
and still, does it have to be a powered or an unpowered usb drive?


Top
   
PostPosted: Mon Mar 14, 2011 6:38 pm 
Offline
Total Newbie

Joined: Fri Jan 28, 2011 10:16 am
Posts: 4
Ok... I've tried either with self powered and bus powered usb drives, but without success...
/etc/cron/crontabs/root is still f*@§£ng write protected
:?


Top
   
PostPosted: Thu Apr 28, 2011 4:23 pm 
Offline
Total Newbie

Joined: Thu Apr 28, 2011 4:20 pm
Posts: 1
It worked!!

Thanks a lot.

Mikel :-)


Top
   
PostPosted: Fri May 13, 2011 7:42 pm 
Offline
Newbie

Joined: Tue Jan 27, 2009 5:42 pm
Posts: 6
zeroquaranta wrote:
chris0583 wrote:
Dude your a ROCK STAR! :up: Works great.

I also tried a USB key and that did not work.

I unplugged all use devices rebooted the TSIII and then plugged in a usb drive (NOT A KEY) according to the steps and it worked great.


Hi Chris,

ok, I'm gonna try with a USB drive... but what do you mean with "unplugged all use devices" ?

Thx


Sorry for the bad typing. I meant unplug all USB devices. Reboot TSIII and plug USB drive in and follow steps.


Top
   
PostPosted: Sat May 14, 2011 4:27 pm 
Offline
Newbie

Joined: Mon Mar 07, 2011 3:58 pm
Posts: 38
If the you are able to execute commends as root using acp_commander, the solution for LS-VL (see http://buffalo.nas-central.org/wiki/Ope ... ware_LS-VL) should work, too, and required much less steps to be performed.


Top
   
PostPosted: Tue Jun 07, 2011 10:15 am 
Offline
Total Newbie

Joined: Tue Jun 07, 2011 10:08 am
Posts: 1
That worked brilliantly. Thanks!

I did get "operation not allowed" on chmod 644 /etc/shadow but as the password had been changed by this point I telnet to localhost as root and chmod'ed the file etc...


Top
   
PostPosted: Wed Jun 13, 2012 9:29 pm 
Offline
Total Newbie

Joined: Wed Jun 13, 2012 9:21 pm
Posts: 1
Well I never got the /etc/cron/crontabs/root writeable using a usb Stick or drive, but I just did following:

Code:
java -jar acp_commander.jar -t $IP -c "chmod 777 /etc/cron/crontabs/root" -ip $IP


So it is writeable after it in telnet as admin ... ;-)


BR
Seq


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 13 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited