Page 10 of 26
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sun Jun 22, 2014 4:53 pm
by bobiturboto
sectroyer wrote:Okay for some reason it doesn't like /mnt/bin/sh... Change this:
Code: Select all
if [ ! -e /mtd_rwarea/passwd ]; then
echo "root:saJvQKUdIxRW2:0:0:SamyGO secured Root:$HOME:/mnt/bin/sh" > /mtd_rwarea/passwd
fi
To this:
Code: Select all
if [ ! -e /mtd_rwarea/passwd ]; then
echo "root:saJvQKUdIxRW2:0:0:SamyGO secured Root:$HOME:/bin/sh" > /mtd_rwarea/passwd
fi
Then this:
Code: Select all
umount /mtd_rwarea/passwd
rm /mtd_rwarea/passwd
reboot tv and this:
Code: Select all
root@tv:/mnt # cat /mtd_rwarea/passwd
root:saJvQKUdIxRW2:0:0:SamyGO secured Root:/mnt/:/bin/sh
Now I have ssh access but no sftp.
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sun Jun 22, 2014 4:56 pm
by sectroyer
bobiturboto wrote:
Now I have ssh access but no sftp.
I did not allow you to test sftp

First you need to make scp work. On your computer run this command:
and:
Code: Select all
echo 1 > /tmp/test.txt
scp /tmp/test.txt root@ip_of_your_TV:/tmp/
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sun Jun 22, 2014 5:11 pm
by bobiturboto
sectroyer wrote:bobiturboto wrote:
Now I have ssh access but no sftp.
I did not allow you to test sftp

First you need to make scp work. On your computer run this command:
and:
Code: Select all
echo 1 > /tmp/test.txt
[code]scp /tmp/test.txt root@ip_of_your_TV:/tmp/
[/quote]
Code: Select all
users-MacBook:~ user$ ssh root@192.168.0.101 "set"
root@192.168.0.101's password:
HOME='/mnt/'
IFS='
'
LOGNAME='root'
OPTIND='1'
PATH='/dtv/bin:/bin'
PPID='3118'
PS1='\w \$ '
PS2='> '
PS4='+ '
PWD='/mnt'
SHELL='/bin/sh'
SSH_CONNECTION='192.168.0.17 54217 192.168.0.101 22'
USER='root'
users-MacBook:~ user$
Code: Select all
users-MacBook:~ user$ scp /tmp/test.txt root@192.168.0.101:/tmp/
root@192.168.0.101's password:
sh: scp: not found
lost connection
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sun Jun 22, 2014 5:13 pm
by sectroyer
okay one final touch. in the telnet init script right before this:
Code: Select all
if [ ! -e /mtd_rwarea/passwd ]; then
echo "root:saJvQKUdIxRW2:0:0:SamyGO secured Root:$HOME:/bin/sh" > /mtd_rwarea/passwd
fi
put this:
reboot tv and run this on your computer:
Code: Select all
scp /tmp/test.txt root@ip_of_your_TV:/tmp/
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sun Jun 22, 2014 5:21 pm
by bobiturboto
Code: Select all
users-MacBook:~ user$ scp /tmp/test.txt root@192.168.0.101:/tmp/
root@192.168.0.101's password:
test.txt 100% 2 0.0KB/s 00:00
users-MacBook:~ user$
Works

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sun Jun 22, 2014 5:26 pm
by sectroyer
bobiturboto wrote:Code: Select all
users-MacBook:~ user$ scp /tmp/test.txt root@192.168.0.101:/tmp/
root@192.168.0.101's password:
test.txt 100% 2 0.0KB/s 00:00
users-MacBook:~ user$
Works

now you can check the other way on tv try to ssh/scp to your computer

Also you should be able to use your sftp now

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sun Jun 22, 2014 5:39 pm
by bobiturboto
Yes it's works in opposite direction too.
Code: Select all
root@tv:/mnt $ scp /tmp/test.txt turbo@192.168.0.12:/tmp/
turbo@192.168.0.12's password:
test.txt 100% 2 0.0KB/s 00:00
root@tv:/mnt $
sftp doesn't work but I think we need extra packages
http://linuxexplore.com/how-tos/sftp-se ... -dropbear/
Thank you very much about your help, great work.
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sun Jun 22, 2014 5:48 pm
by sectroyer
I think with this changes sftp worked for me on E... Let's test it more carefully run this:
Code: Select all
/bin/ps | grep dropbear
killall -KILL dropbear
/bin/ps | grep dropbear
dropbear -F -E
and then try to use sftp in other terminal window. BTW why do you want to use sftp if you have ftp and scp ?

Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sun Jun 22, 2014 6:09 pm
by bobiturboto
sectroyer wrote:I think with this changes sftp worked for me on E... Let's test it more carefully run this:
Code: Select all
/bin/ps | grep dropbear
killall -KILL dropbear
/bin/ps | grep dropbear
dropbear -F -E
and then try to use sftp in other terminal window. BTW why do you want to use sftp if you have ftp and scp ?

It's sftp very good if you want to connect securely from outside if you using windows workstation + filezilla for example.
I am sure that nobody will keep the tv powered all of the time, but for emergency purposes, why not.
It's not mandatory but is good to have it.
Code: Select all
root@tv:/mnt # /bin/ps | grep dropbear
1814 root 0:00 dropbear
3419 root 0:00 grep dropbear
root@tv:/mnt # killall -KILL dropbear
root@tv:/mnt # /bin/ps | grep dropbear
3439 root 0:00 grep dropbear
Code: Select all
Status: Connecting to 192.168.0.101...
Response: fzSftp started
Command: open "root@192.168.0.101" 22
Command: Pass: ******
Status: Connected to 192.168.0.101
Error: Connection closed by server with exitcode 127
Error: Could not connect to server
Code: Select all
root@tv:/mnt # dropbear -F -E
[3466] Jun 22 17:03:12 Failed reading '/etc/dropbear/dropbear_dss_host_key', disabling DSS
[3466] Jun 22 17:03:12 Not backgrounding
[3504] Jun 22 17:04:28 Child connection from 192.168.0.17:54898
[3504] Jun 22 17:04:28 Password auth succeeded for 'root' from 192.168.0.17:54898
[3504] Jun 22 17:04:28 Exit (root): Exited normally
[3512] Jun 22 17:04:33 Child connection from 192.168.0.17:54899
[3512] Jun 22 17:04:34 Password auth succeeded for 'root' from 192.168.0.17:54899
[3512] Jun 22 17:04:34 Exit (root): Exited normally
Re: Fixing SamyGO telnet/SSH/SCP/bash on C/D/E/F series
Posted: Sun Jun 22, 2014 6:19 pm
by sectroyer
On dropbear side everything works to get sftp working you need to install another packages. I am not interested in investigating it any further. SFTP IS NOT PART of dropbrea. This is NOT a bug

You can use mc/winscp/etc or any other application that supports SCP protocol

There three protocols: SCP, SFTP and FTPS. Everyone is different and dropbear (ergo SamyGO ) supports only SCP
BTW it would be great if you could summarize all the changes that we have made and prepare a tutorial for F users
