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.

2
  • 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). Commented Sep 30, 2018 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".) Commented Oct 1, 2018 at 11:28

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .