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

Here are software that related with Samsung F series TVs.
Please don't create any new topic here unless you have software to post/release.

m2tk
SamyGO Project Donor
Posts: 38
Joined: Wed Aug 28, 2013 8:32 pm

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

Post by m2tk »

zoelechat wrote:Why don't you simply get samyext4.img from there ?
Telnet/ssh/etc fix is already included.
I have taken it from there already.

/mnt/etc/init.d/01_02_telnet.init
does not contain modification described here for F series.

My TV is UE40F6400 so MST one. This is too simple to make any errors.
1. Replace dropbearmulti
2. Replace 2 lines of code in 01_02_telnet.init
3. Remove /mtd_rwarea/passwd
4. Delete dropbear and make symlinks to new one.

OK, going to try it once again from scratch.
Last edited by m2tk on Thu Jan 07, 2016 8:52 pm, edited 1 time in total.

zoelechat
Official SamyGO Developer
Posts: 8445
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

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

Post by zoelechat »

m2tk wrote:/mnt/etc/init.d/01_02_telnet.init does not contain modification described here for F series.
No idea, but it does include ssh and full Telnet, no point in applying fix to already fixed stuff :)
I do NOT receive any PM. Please use forum.

m2tk
SamyGO Project Donor
Posts: 38
Joined: Wed Aug 28, 2013 8:32 pm

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

Post by m2tk »

Colors, bash history etc?
Can SSH on port 22 with putty?

Shouldn't I get something like root@tv: instead of VDLinux#>?

I can SSH from TV to my router, but not the other way "Connection refused".
I have history and colours in telnet. Is that all or should I be able to connect SSH to TV?

I have seen that someone have this in his 01_02_telnet.init

Code: Select all

Automatic mount of /dev/pts
    /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
    sync; sleep 2
There is no such in the procedure.
Last edited by m2tk on Thu Jan 07, 2016 9:28 pm, edited 1 time in total.

kartu
Posts: 22
Joined: Fri Jan 17, 2014 9:28 pm

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

Post by kartu »

Rooted ES series Skype way.

Followed the instructions in this thread, but it didn't quite work.
Telnet was there, but it was a wrong one.

PS revealed there is "samygo_telnetd" running. Killing it before starting telnetd with new busybox worked.

So a dumb question: what does start samygo_telnetd? (I don't see any mention of it in init.d scripts)
I have oscam running, it takes about 70 sec to start, so I want to remove all unnecessary stuff from the startup. =/

zoelechat
Official SamyGO Developer
Posts: 8445
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

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

Post by zoelechat »

m2tk wrote:Colors, bash history etc?
Can SSH on port 22 with putty?

Shouldn't I get something like root@tv: instead of VDLinux#>?

I can SSH from TV to my router, but not the other way "Connection refused".
I have history and colours in telnet. Is that all or should I be able to connect SSH to TV?
Well, img is obviously older than I thought, probably not fixed then, I thought sectroyer did so :D
kartu wrote:PS revealed there is "samygo_telnetd" running. Killing it before starting telnetd with new busybox worked.

So a dumb question: what does start samygo_telnetd? (I don't see any mention of it in init.d scripts)
samygo_telnetd is supposed to be some "safety" Telnet, normally launched on port 2023, if it's on 23 it's bad, and true that some SamyGO-E version included this mistake :)
Anyway it doesn't take long to start, you should more focus on early startup scripts, or launch oscam just after catch_crap.
I do NOT receive any PM. Please use forum.

kartu
Posts: 22
Joined: Fri Jan 17, 2014 9:28 pm

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

Post by kartu »

zoelechat wrote:
kartu wrote:PS revealed there is "samygo_telnetd" running. Killing it before starting telnetd with new busybox worked.

So a dumb question: what does start samygo_telnetd? (I don't see any mention of it in init.d scripts)
samygo_telnetd is supposed to be some "safety" Telnet, normally launched on port 2023, if it's on 23 it's bad, and true that some SamyGO-E version included this mistake :)
Anyway it doesn't take long to start, you should more focus on early startup scripts, or launch oscam just after catch_crap.
Thanks.
It's just, I don't even see any mention of it in init.d scripts that puzzles me.

webber33
Posts: 4
Joined: Wed Feb 24, 2016 8:45 pm

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

Post by webber33 »

Hi Guys,

i need your help. I tried to fix shh on my f-series. But it doesnt work. Sometimes the Tv reboots after 3-4 minutes.

Telnet does'nt work anymore. connection refused.
SSH is working, put permission denied with pass "SamyGO"


cat 01_02_telnet.init

Code: Select all

#!/mnt/bin/busybox sh
#
# ? Copyright 1996-2013, SamyGO
#
#
. /dtv/SGO.env

stop_bootloop()
{
# emergency skript exit to prevent boot loop
      for USB in ${1:- \
         /dtv/usb/sd* } ; do
         echo "checking $USB"
         sleep 1
         if [ -e $USB/STOP_TELNET ]; then
            "STOP_TELNET found. Script exit..."
            exit 1
         fi
      done
}

case $1 in
        start)
        stop_bootloop # in testing phase. Just for protection.
#antishell, mount, console unlock, authuld exception, printk restrictions:
        insmod $MOD_DIR/kernel/drivers/pty/SRS_module.ko >> $LOGFILE 2>&1
        sync; sleep 1
                echo " " >> $LOGFILE 2>&1
                echo "++++++++++++++++++++++++++++++++++" >> $LOGFILE 2>&1
                echo "lsmod after insmod SRS_module.ko:" >> $LOGFILE 2>&1
                echo "++++++++++++++++++++++++++++++++++" >> $LOGFILE 2>&1
                        lsmod   >> $LOGFILE 2>&1
                echo " " >> $LOGFILE 2>&1

#modules with dynamic addressing by bugficks:
        insmod $MOD_DIR/kernel/drivers/pty/ptys.ko >> $LOGFILE 2>&1 # alternative to pty.ko and devpts.ko from bugficks. Automatic mount of /dev/pts
        /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
        sync; sleep 2

# true telnet
        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
   sync

#### E/F series: bind option is prohibited, you have to load proper mount.ko to use mount --bind.
        #mount our profile over original /etc/profile if mount.ko is loaded and mount issue fixed:
        $SYSROOT/bin/busybox mount -o bind /mtd_rwarea/profile /etc/profile || echo "can not mount profile!" && dmesg | tail >> $LOGFILE 2>&1

# mount our passwd file over original one (/bin/sh changed to /mnt/bin/sh )
        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
        $SYSROOT/bin/busybox mount -o bind /mtd_rwarea/passwd /etc/passwd || echo "can not mount passwd" && dmesg | tail  >> $LOGFILE 2>&1
                echo " " >> $LOGFILE 2>&1
                echo "++++++++++++++++++++++++++++++++++" >> $LOGFILE 2>&1
                echo "checking mount --bind:"  >> $LOGFILE 2>&1
                echo "++++++++++++++++++++++++++++++++++" >> $LOGFILE 2>&1
        $SYSROOT/bin/busybox mount | grep "etc"  >> $LOGFILE 2>&1
                echo " " >> $LOGFILE 2>&1
                echo "++++++++++++++++++++++++++++++++++" >> $LOGFILE 2>&1
                echo "dmesg -c:"  >> $LOGFILE 2>&1
                echo "++++++++++++++++++++++++++++++++++" >> $LOGFILE 2>&1
                        dmesg -c >> $LOGFILE 2>&1
                echo "++++++++++++++++++++++++++++++++++" >> $LOGFILE 2>&1
        ;;
        stop)
        ;;
        status)
        ;;
        *)
        echo "Usage: $0 {start|stop|status}" 1>&2
        exit 0
        ;;
esac 
cat /etc/passwd

Code: Select all

 root::0:0Root,,,:/:/bin/sh 
cat /mtd_rwarea/passwd

Code: Select all

 root:saJvQKUdIxRW2:0:0:SamyGO secured Root::/bin/sh
$home is empty


Thanks in advance.

sectroyer
Official SamyGO Developer
Posts: 5940
Joined: Wed May 04, 2011 5:10 pm

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

Post by sectroyer »

mount -o bind /mtd_rwarea/passwd /etc/passwd
you missed this one :)
I do NOT support "latest fw" at ALL. If you have one you should block updates on router and wait for it to STOP being "latest":)
If you want me to help you please paste FULL log(s) to "spoiler"/"code" bbcodes or provide link(s) to pasted file(s) on http://ctrlv.it/ Otherwise "NO HELP"!!!
If you want root DISABLE internet access to your device!!!!
DO NOT EVER INSTALL FIRMWARE UPGRADE !!!!

webber33
Posts: 4
Joined: Wed Feb 24, 2016 8:45 pm

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

Post by webber33 »

Hi sectroyer,

/bin/mount -o bind /mtd_rwarea/passwd /etc/passwd

was in the init script. What ca i do? Is there a newer script that i can use?

Thanks.

Code: Select all

#modules with dynamic addressing by bugficks:
        insmod $MOD_DIR/kernel/drivers/pty/ptys.ko >> $LOGFILE 2>&1 # alternative to pty.ko and devpts.ko from bugficks. Automatic mount of /dev/pts
        /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
        sync; sleep 2

# true telnet
        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
   	sync


sectroyer
Official SamyGO Developer
Posts: 5940
Joined: Wed May 04, 2011 5:10 pm

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

Post by sectroyer »

Well NOT works :) You need to fix that. Without it won't work. You can try running manually and see what's the output :)
I do NOT support "latest fw" at ALL. If you have one you should block updates on router and wait for it to STOP being "latest":)
If you want me to help you please paste FULL log(s) to "spoiler"/"code" bbcodes or provide link(s) to pasted file(s) on http://ctrlv.it/ Otherwise "NO HELP"!!!
If you want root DISABLE internet access to your device!!!!
DO NOT EVER INSTALL FIRMWARE UPGRADE !!!!

Post Reply

Return to “[F] Software”