0

I want to transfer files wirelessly between my android phone and Linux computer (XUbuntu 18.04). It works when I use SSHDroid as an SSH server on my phone and connect to it with sshfs to mount the phone's files as a disk on my computer. But in order to create a script to regularly mount my phone as a disk, I have to enter the IP address of the phone in the options to sshfs. The problem is that the IP address of my phone changes sometimes, so I have to keep changing the command to mount it every time.

Can I keep the IP address of my phone the same? Or are there any other ideas to work around this problem? I don't want to store my files in the cloud, I just want to sync them between my phone and computer.

  • Configure your wireless router's dhcp server to assign static IP to your phone (provide MAC address). Or when syncing data, create hotspot on phone and connect Linux machine to this access point. Phone will act as a router and will have a fixed IP (usually 192.168.43.1). – Irfan Latif Sep 30 '18 at 21:21
  • Thanks, assigning an IP address using my router worked. (I would accept that as the answer, but I can't since it's a comment.) A hotspot isn't an option for me because my computer doesn't have wifi, and anyway creating one requires turning off the phone's wifi connection. (Sorry I wasn't that clear: when I said "transfer files wirelessly" I meant "transfer files without plugging my phone in with a wire".) – user2596667 Oct 1 '18 at 11:28
1

Two of the easy possible solutions:

  • Configure your wireless router's dhcp server to assign static IP to your phone (provide MAC address).
  • If you don't need internet connection when syncing data, create hotspot on phone and connect Linux machine to this access point. Phone will act as a router and will have a fixed IP (usually 192.168.43.1).

Related: Static IP Configuration

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.