Page 11 of 26

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series

Posted: Sun Jun 22, 2014 6:51 pm
by bobiturboto
FOR F 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.

Upload and replace /mnt/opt/privateer/usr/sbin/dropbearmulti with the attached file.

Locate these lines in /mnt/etc/init.d/01_02_telnet.init :

Code: Select all

$SYSROOT/bin/busybox2 telnetd -p 23 -l $SYSROOT/bin/ash &  >> $LOGFILE 2>&1
Replace the line with this:

Code: Select all

	echo "export PS1='root@tv:\w \$ '" >> /mtd_rwarea/profile
	echo -e "ENV=/dtv/.ashrc\nexport ENV\n" >> /mtd_rwarea/profile
	echo "PS1='root@tv:\w \$ '" >> /mtd_rwarea/profile
	echo -e "ENV=/dtv/.ashrc\nexport ENV\n" >> /mtd_rwarea/profile
	/bin/mount -o bind "$SYSROOT/bin/sh" /bin/sh
	export HOME=/mnt/
	export PS1='root@tv:\w \$ '
	$SYSROOT/bin/busybox2 telnetd -p 23 -l $SYSROOT/bin/sh &  >> $LOGFILE 2>&1
In the same file find this part:

Code: Select all

        if [ ! -e /mtd_rwarea/passwd ]; then
                echo "root:saJvQKUdIxRW2:0:0:SamyGO secured Root:$NEW_HOME:$SYSROOT/bin/ash" > /mtd_rwarea/passwd
        fi
Replace it with this:

Code: Select all

	ln -s /mnt/bin/ /dtv/bin
		if [ ! -e /mtd_rwarea/passwd ]; then
                echo "root:saJvQKUdIxRW2:0:0:SamyGO secured Root:$HOME:/bin/sh" > /mtd_rwarea/passwd
        fi
Then run this commands:

Code: Select all

umount /mtd_rwarea/passwd
rm /mtd_rwarea/passwd
Execute the listed commands through telnet connection.

Code: Select all

chmod +x /mnt/opt/privateer/usr/sbin/dropbearmulti
rm /mnt/opt/privateer/usr/sbin/dropbear
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
Reboot your TV and after that you will have fixed telnet and working ssh access with scp and ssh history.
Default ssh user is root and the password is SamyGO

Credits to sectroyer.

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series

Posted: Mon Jun 23, 2014 8:56 am
by sectroyer
I changed the tutorial. No need to edit passwd manually. Running this is enough:

Code: Select all

umount /mtd_rwarea/passwd
rm /mtd_rwarea/passwd

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series

Posted: Mon Jun 23, 2014 11:29 am
by bobiturboto
sectroyer wrote:I changed the tutorial. No need to edit passwd manually. Running this is enough:

Code: Select all

umount /mtd_rwarea/passwd
rm /mtd_rwarea/passwd
Sometimes umount throwing me the errors about busy resources. For this reason I have decided to use edit instead of delete. But you are right delete is more mistake proof.

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series

Posted: Mon Jun 23, 2014 11:38 am
by sectroyer
Okay glad you have everything working

Re: Fixing SamyGO telnet/SSH/SCP/bash on C series

Posted: Wed Jul 16, 2014 5:14 pm
by juusso
For D series i did part of E series recomendations and got scp + history:
sectroyer wrote: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 :)
Used attached binaries. To start ssh just enable script ( 03_03_sshd.init )

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series

Posted: Wed Jul 23, 2014 11:23 pm
by gogo
When I start '03_03_sshd.init' script I get this error:

/mnt/opt/privateer/usr/sbin/dropbear: line 1: syntax error: unexpected word (expecting ")")

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series

Posted: Wed Jul 23, 2014 11:34 pm
by bobiturboto
gogo wrote:When I start '03_03_sshd.init' script I get this error:

/mnt/opt/privateer/usr/sbin/dropbear: line 1: syntax error: unexpected word (expecting ")")
If you have F series you need to follow the instructions from here and should work viewtopic.php?f=63&t=7455&p=61496#p60720
Tested with F8000
Keep in your mind if you use ftp for dropbear file transfer, the transfer mode needs to be binary type.

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series

Posted: Thu Jul 24, 2014 12:00 am
by gogo
bobiturboto wrote:
gogo wrote:When I start '03_03_sshd.init' script I get this error:

/mnt/opt/privateer/usr/sbin/dropbear: line 1: syntax error: unexpected word (expecting ")")
If you have F series you need to follow the instructions from here and should work viewtopic.php?f=63&t=7455&p=61496#p60720
Tested with F8000
Keep in your mind if you use ftp for dropbear file transfer, the transfer mode needs to be binary type.
I forgot type binary in ftp shell

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series

Posted: Thu Jul 24, 2014 1:10 pm
by gogo
Why this command don't work?

umount /mtd_rwarea/passwd
umount: can't umount /mtd_rwarea/passwd: Invalid argument

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series

Posted: Thu Jul 24, 2014 1:48 pm
by sectroyer
gogo wrote:Why this command don't work?

umount /mtd_rwarea/passwd
umount: can't umount /mtd_rwarea/passwd: Invalid argument
because you are not using latest stuff :) As a result your /mtd_rwarea/passwd is not mounted. You can check it by running:

Code: Select all

mount