2

SSHDroid lets an android device function as an ssh server. vSSH is an ssh client for android devices.

I have a file on a remote server that I want to transfer to my android device over ssh, only using the android device in the process.

Using this setup, I tried an scp from the android device

scp remote_user@remote_host:file file

After being prompted for the password I got permission denied.

I then tried to transfer it from the remote server

scp -P 2222 file root@SSHDroid-ip:/mnt/extSdCard/file

Without being prompted for the password I now get the message that the network (of the android device) is unreachable: lost connection.

Is this a permission problem? I have transferred files over ssh from the remote server before, so I suppose the problem is on the side of the android device.

  • "Permission denied" where? Reading the file remotely? Authenticating? Writing the file locally? For your second attempt, did you configure the android's ssh server to run on port 2222? Are you doing this over a LAN or over the internet? – Jason C Jul 17 '14 at 3:36
  • I get the permission denied message after being prompted for the password on the remote server. file: Permission denied. So I suppose it got denied at the remote server? On the first attempt I am reading the file remotely, while using vSSH on the android device. On the second attempt I am on the remote server and writing the file to the android device. SSHDroid does indeed default to port 2222. I am doing it over LAN. Moreover, since I can connect to the android device (using the android device itself) with vSSH via port 2222 I do not think that the port number is the problem. – Mussé Redi Jul 17 '14 at 3:49
  • What happens if you do touch file on the Android device? Or if Android doesn't have touch, something like echo abc > file? – Jason C Jul 17 '14 at 3:58
  • I can not seem to 'touch' the file (which is on the remote server) from the android device: No such file or directory. – Mussé Redi Jul 17 '14 at 4:10
  • I mean locally. In your first example you have scp user@remote:remotefile localfile. Can you actually write to localfile? Because if you go to that directory in whatever Android console you are using, and touch localfile or echo abc > localfile gives you a permission denied error, then this tells us you do not have write permissions to that location on the Android. – Jason C Jul 17 '14 at 4:17
2

Your scp from android to the remote server permission denied means:

  • You didn't have the password right
  • You don't have permission to read the remote file or
  • You don't have permission to write the local file

Usually the answer is the third as android differs from most unix in who can write what where.

(I know this is answered in the comments, but if you don't mark it answered more people will waste time reading it like I did!)

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.