lewislau86 / droidsshd

Automatically exported from code.google.com/p/droidsshd
0 stars 0 forks source link

SCP support #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. SCPing to/from a device running DroidSSHd is expected/supposed to work
2. however, this haven't been thoroughly tested  

What is the expected output? What do you see instead?
Works fine on N1 running CM 6.x, but a user reported 'strange issues' on a 
Samsung Galaxy 5 (not a lot on information on that).

Original issue reported on code.google.com by augu...@bott.com.br on 25 Dec 2010 at 5:08

GoogleCodeExporter commented 8 years ago
SCP works fine with v0.6 on froyo (both emulator and rooted device). 

Original comment by augu...@bott.com.br on 19 Jan 2011 at 11:42

GoogleCodeExporter commented 8 years ago
testing on a rooted nexus S device and scp does not work. when trying to scp 
from another machine, login does work but then android prints back "scp not 
found".

i'm trying to locate the scp binary right now and have not located it yet. i'll 
dig around some more to see if i can find it and manually execute it from 
android rather than trying to scp from my machine.

Original comment by ele...@gmail.com on 21 Jan 2011 at 7:58

GoogleCodeExporter commented 8 years ago

Original comment by augu...@bott.com.br on 22 Jan 2011 at 7:54

GoogleCodeExporter commented 8 years ago
Hey Guys,

Great work here. I am interested in running an scp client phone-side from the 
android terminal to transfer files to and from my phone via scp, however, I am 
having problems locating an scp binary, have you guys had any luck?

Cheers,

MatB

Original comment by Mu.Beta...@gmail.com on 22 Mar 2011 at 9:37

GoogleCodeExporter commented 8 years ago
[russell@studio ~]$ scp -P 2222 android@192.168.1.126:/mnt/sdcard/fish .
android@192.168.1.126's password: 
scp: permission denied
[russell@studio ~]$ 

Permission denied seems to be what I get when ever a command is not found.

This is on a non-rooted Nexus S

Original comment by russells...@gmail.com on 23 Jul 2011 at 1:47

GoogleCodeExporter commented 8 years ago
using a rooted Thunderbolt scp continually gives:  unknown user 0

Original comment by EmperorA...@gmail.com on 25 Nov 2011 at 6:12

GoogleCodeExporter commented 8 years ago
Without an scp binary on the android device you can't talk scp to it from 
outside.  Same issue applies to sftp - issue #1

Original comment by rogerbinns on 17 Dec 2011 at 4:25

GoogleCodeExporter commented 8 years ago
There is an scp binary included (uses dropbearmulti) which isn't found when 
using scp from outside.  But even if it was it just whines about unknown user 
as comment 6 shows.  (I tried creating /etc/passwd but that didn't help.)

Original comment by rogerbinns on 17 Dec 2011 at 4:37

GoogleCodeExporter commented 8 years ago
anyone come up with a solution to this?  using an Acer A200 w/ICS.  Have the 
same scp error.  Also, ssh fails w/ "Unknown own user".

Original comment by listmail...@gmail.com on 25 Mar 2012 at 8:18

GoogleCodeExporter commented 8 years ago
while messing around with android emulator i found two workarounds.  only mild 
testing has been done.  both ssh and scp are binaries found in /system/xbin on 
the emulator after boot.  This seems to be a filesystem presented by the 
emulator that overrides your underlying /system/xbin in your image/sysdir.  
Anyway I copied these binaries over to /system/bin on the tablet.

# from external
$ scp -P2222 t.txt root@192.168.0.129:/mnt/external_sd/
root@192.168.0.129's password: 
t.txt                                                                           
                              100%    0     0.0KB/s   00:00

# from the tablet
$ ssh -lsomeuser someserver
ssh: Warning: Reading the random source seems to have blocked.
If you experience problems, you probably need to find a better entropy source.

just rename /dev/random and link to urandom
cd /dev && mv random random.old
ln -s urandom random
(see http://pissedoffadmins.com/?p=60)

Original comment by listmail...@gmail.com on 26 Mar 2012 at 1:55

GoogleCodeExporter commented 8 years ago
From this post: 
http://www.acertabletforum.com/forum/acer-a200-hacking/4049-droidsshd-incoming-s
cp-outgoing-ssh-workarounds.html

There is a package of ssh & scp available for download:
http://db.tt/QCvdFqXT

Unzip, and put scp into /system/xbin would solve this problem.

Original comment by Henry.Hu...@gmail.com on 1 Apr 2012 at 2:23

GoogleCodeExporter commented 8 years ago
For now, while there is now SFTP for this SSHd installed on a non-rooted 
device, one can use plain "ssh" and "cat" to transfer files to the device (and 
the output of "ls" to assist continuing a partial trnasfer).

I've written simple helper scripts for this -- https://gitorious.org/rpush-cat 
or http://repo.or.cz/w/rpush-cat.git:

Usage:

rpush SRC DEST ssh SSH_args..
rpush-continue SRC [--android|--unix] DEST ssh SSH_args..  
rpush-into [-c|--continue] FILE REMOTE_PREFIX ssh SSH_args..

Original comment by z.va...@gmail.com on 31 Aug 2012 at 5:32

GoogleCodeExporter commented 8 years ago
Thanks for comment 11 which solved my problem. I could not use scp because the 
one in DroidSSHD is not valid. The one in the sshscp_bin.zip package is valid 
so we just need to replace this one in a known path such as /system/xbin/scp 
and voila.

Thanks again

Original comment by saidel...@gmail.com on 2 Oct 2012 at 3:46

GoogleCodeExporter commented 8 years ago
Actually there is a simpler solution. The scp that comes with dropbear server 
is in fact valid (but the dropbear server doesn't know the path to it!). 
However there is an scp (on my blade anyway) that is already installed in 
/system/xbin. It is this scp that seems to be invalid. The fix is just to move 
this one out of the way and copy the dropbear one in:

# /system/xbin/scp
/system/xbin/scp: not found ## this is the error I get from scp on a remote host
# mount -o remount,rw /system
# mv /system/xbin/scp /system/xbin/scp.orig
# find / -name scp
/data/data/berserker.android.apps.sshdroid/dropbear/scp
# cp /data/data/berserker.android.apps.sshdroid/dropbear/scp /system/xbin/scp
# scp
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 [...] [[user@]host2:]file2
# mount -o remount,ro /system

Now it all works perfectly.

Original comment by aq.bl...@googlemail.com on 30 Dec 2012 at 3:37