Page 18 of 26
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Tue Apr 14, 2015 7:55 pm
by tempinbox
sectroyer wrote:Your rcEXT:
Code: Select all
#!/bin/sh
source /dtv/SGO.env
#echo "alias sgopwd='cd $1'" >> /dtv/SGO.env
echo "#!/mtd_rwarea/sh" > /dtv/sgoshfix
echo ". /dtv/SGO.env" >> /dtv/sgoshfix
echo "export HOME=\"$1\"" >> /dtv/sgoshfix
echo "export TERMINFO='$1/etc/terminfo'" >> /dtv/sgoshfix
echo "export TERM='xterm-color'" >> /dtv/sgoshfix
echo "export FRAMEBUFFER='/dev/sam/fb0'" >> /dtv/sgoshfix
echo "export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"" >> /dtv/sgoshfix
echo "export PATH=\"$PATH\"" >> /dtv/sgoshfix
echo "export SYSROOT=\"$SYSROOT\"" >> /dtv/sgoshfix
echo "export PS1='\u@tv:\w \\$ '" >> /dtv/sgoshfix
chmod +x /dtv/sgoshfix
ln -s "$SYSROOT/opt/privateer/usr/bin" /dtv/bin
for i in `cat $1/rcCMDs`
do
cp /mtd_rwarea/busybox /dtv/bin/$i
done
$1/etc/rc.fix_telnetd&
Now run:
Code: Select all
source /dtv/SGO.env
$SYSROOT/rcEXT $SYSROOT
here is what i get
Code: Select all
/ # source /dtv/SGO.env
/ # $SYSROOT/rcEXT $SYSROOT
ln: /dtv/bin/bin: Operation not permitted
killall: telnetd: no process killed
/dtv/usb/sda1/SamyGO/etc/rc.fix_telnetd: line 5: telnetd: not found
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Tue Apr 14, 2015 8:20 pm
by sectroyer
Okay good now in rc.fix_telnetd put this:
Code: Select all
#!/mtd_rwarea/sh
killall telnetd
. /dtv/sgoshfix
cd
/mtd_rwarea/busybox telnetd -l /mtd_rwarea/sh
And same test as last time

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Wed Apr 15, 2015 10:00 am
by tempinbox
sectroyer wrote:Okay good now in rc.fix_telnetd put this:
Code: Select all
#!/mtd_rwarea/sh
killall telnetd
. /dtv/sgoshfix
cd
/mtd_rwarea/busybox telnetd -l /mtd_rwarea/sh
And same test as last time

Same error again
Code: Select all
/ # source /dtv/SGO.env
/ # $SYSROOT/rcEXT $SYSROOT
ln: /dtv/bin/bin: Operation not permitted
killall: telnetd: no process killed
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Wed Apr 15, 2015 12:43 pm
by sectroyer
Nah the error is NOT the same

Which script currently starts telnet for you ?
and after running the commands above run:
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sat Apr 18, 2015 11:31 am
by tempinbox
sectroyer wrote:Nah the error is NOT the same

Which script currently starts telnet for you ?
and after running the commands above run:
The script that run telnet is run.sh in the root of usb (sda1)
Code: Select all
#!/bin/sh
date > $1/ScriptOK
if !([ -e /mtd_rwarea/busybox ]); then
cp $1/busybox /mtd_rwarea/
chmod 777 /mtd_rwarea/busybox
sync
fi
if !([ -e /mtd_rwarea/sh ]); then
ln -s /mtd_rwarea/busybox /mtd_rwarea/sh
chmod 777 /mtd_rwarea/sh
sync
fi
mount -t devpts devpts /dev/pts
/mtd_rwarea/busybox telnetd -l /mtd_rwarea/sh
/mtd_rwarea/busybox tcpsvd -vE 0.0.0.0 21 /mtd_rwarea/busybox ftpd -w / &
sync
rm -f /mtd_rwarea/profile
here are the sesult
Code: Select all
/ # source /dtv/SGO.env
/ # $SYSROOT/rcEXT $SYSROOT
ln: /dtv/bin/bin: Operation not permitted
killall: telnetd: no process killed
/ # ps aux | grep telnet
661 root 1200 SW /mtd_rwarea/busybox telnetd -l /mtd_rwarea/sh
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sat Apr 18, 2015 11:41 am
by sectroyer
I don't need any "results" for now

Simply run this:
Code: Select all
cp /mtd_rwarea/busybox /mtd_rwarea/telnetd
and in run.sh replace this line:
Code: Select all
/mtd_rwarea/busybox telnetd -l /mtd_rwarea/sh
with this line:
Code: Select all
/mtd_rwarea/telnetd -l /mtd_rwarea/sh
reboot and then post results

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sat Apr 18, 2015 6:14 pm
by tempinbox
sectroyer wrote:I don't need any "results" for now

Simply run this:
Code: Select all
cp /mtd_rwarea/busybox /mtd_rwarea/telnetd
and in run.sh replace this line:
Code: Select all
/mtd_rwarea/busybox telnetd -l /mtd_rwarea/sh
with this line:
Code: Select all
/mtd_rwarea/telnetd -l /mtd_rwarea/sh
reboot and then post results

here are the result
now the fix seems works but i find in the history commands that i don't even run
Code: Select all
test -e '/dtv/usb/sda1/SamyGO/opt/privateer/usr/b
in/samyGOrc' && printf '\x23\x59\x45\x53\x21\n' || printf '\x23\x4e\x4f\x21\n' &
& printf '\x23\x45\x4f\x46\n'
and i don't know what are for.
thanks for getting this working now i can try to get this -->
viewtopic.php?f=75&t=8904 working on c series. any hints?
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sun Apr 19, 2015 10:00 am
by sectroyer
In history you also have commands that SamyGO scripts run

Re: Fixing SamyGO telnet/SSH/SCP/bash on C series
Posted: Mon May 11, 2015 12:14 pm
by miazza
sectroyer wrote:FOR E SERIES YOU HAVE TO DO THIS!!!!!!
You have to use dropbearmulti from archive attached in this post to get scp working for telnet and SSH it is enough to locate in /mnt/etc/rc.sysinit these lines:
Code: Select all
echo "export PS1='# '" >> /mtd_rwarea/profile
echo -e "ENV=/dtv/.ashrc\nexport ENV\n" >> /mtd_rwarea/profile
And change it to:
Code: Select all
echo "PS1='root@tv:\w \$ '" >> /mtd_rwarea/profile
echo -e "ENV=/dtv/.ashrc\nexport ENV\n" >> /mtd_rwarea/profile
ln -s /mnt/bin/ /dtv/bin
Than I have modified ./etc/init.d/01_01_catch_crap.init. I fixed the line with wrong path to mount.ko and added three more. Now it looks like this:
Code: Select all
[ -e $MOD_DIR/kernel/drivers/pty/mount.ko ] && insmod $MOD_DIR/kernel/drivers/pty/mount.ko || echo "mount.ko not found."
/bin/mount -o bind /mtd_rwarea/passwd /etc/passwd
/bin/mount -o bind /mtd_rwarea/profile /etc/profile
/bin/mount -o bind /mnt/bin/sh /bin/sh
Finally fix for telnetd (the same file) :
Code: Select all
export HOME=/mnt/
export PS1='root@tv:\w \$ '
$SYSROOT/bin/busybox2 telnetd -l /mnt/bin/sh
We need to change /bin/sh to /mnt/bin/sh (although at this moment it doesn't matter since we already mount-binded it

) and set up HOME and PS1 variables.
For scp we also needto change dropbearmulti to the one from the archive. Then we just make a symbolic link to dbclient:
Code: Select all
ln -s /mnt/opt/privateer/usr/sbin/dropbearmulti /mnt/bin/dbclient
ln -s /mnt/opt/privateer/usr/sbin/dropbearmulti /mnt/bin/scp
ln -s /mnt/opt/privateer/usr/sbin/dropbearmulti /mnt/opt/privateer/usr/sbin/dropbear
After this I have working bash history, telnet, ssh and scp
EDIT: Attached my /mnt/bin/busybox and dropbearmulti binaries.
So for F8000 I have to follow this except this. Right ?
Code: Select all
[ -e $MOD_DIR/kernel/drivers/pty/mount.ko ] && insmod $MOD_DIR/kernel/drivers/pty/mount.ko || echo "mount.ko not found."
And this will allow me to have a real telnet that provides me echo ?
Right now with Win 8.1 if I map the TV in the network I can see USB,Root and RWCommon. Tjis is quite dangerous if somebody from family is deleting files....
On ES800 I can only see USB.
Re: Fixing SamyGO telnet/SSH/SCP/bash on C series
Posted: Mon May 11, 2015 2:49 pm
by sectroyer
miazza wrote:
So for F8000 I have to follow this except this. Right ?
Code: Select all
[ -e $MOD_DIR/kernel/drivers/pty/mount.ko ] && insmod $MOD_DIR/kernel/drivers/pty/mount.ko || echo "mount.ko not found."
Yeah I think so. You should find the line with SRS_module.ko and AFTER that put next 3 lines
miazza wrote:
And this will allow me to have a real telnet that provides me echo ?
Well not sure if it will fix it but you will definitely need it to make "echo work"
miazza wrote:
Right now with Win 8.1 if I map the TV in the network I can see USB,Root and RWCommon. Tjis is quite dangerous if somebody from family is deleting files....
On ES800 I can only see USB.
I don't udernstand a thing but I can tell you that if you format disk with your Win 8.1 you should be able to install Linux
