IP Address changes when using SSHDroid 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.
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