First of all, the Linino function of uploading a hex program on the startup page does not work. Don't waste time with that.
You will need to add a program to the Yun that will allow it to do SFTP data exchange.
Using a linux shell, open the nano word editor.
In the shell, enter
"nano /etc/resolv.conf"
change the nameserver to the router's gateway server - 192.168.1.254 or whatever it is. See below for how to get the router's gateway. Sorry it's out of sequence. Save the file.
Then, again in the Linux shell-
opkg update
opkg install openssh-sftp-server
this is so filezilla can talk to the Yun via FTP and SFTP.
What follows is what I did - it works. I can remotely program my Yun's Arduino controller with HEX files generated by the Arduino IDE, access all of the the Linux side files with Filezilla and control it with the Linux shell using PUTTY. I can restart the Arduino program running my device and I can reboot the entire system from my home in another state. I can also access the Luci web pages to reconfigure the Linux side via a remote web browser, any way I want. I can only tell you what works on my windows system; sorry if you have Apple or Linux.
Get local network access to your router. Go to the search bar of your computer, type "cmd", go to the shell window, type "ipconfig" and look for the ip address of the default gateway. Write it down. Open a browser, type in the ip address, either with or without "http://" first. You are now in the router setup pages and you are SOOO on your own for a while, because you will have to set up port forwarding for ports 22, 23, 80 and 8080. Ports 22 and 23 are for FTP and SFTP communication protocols and 80 and 8080 are for connecting to the web browser. Every router is sadistically different on how to do this.
With port forwarding, you will be able to access your yun through your router using SFTP and HTTP from the outside ONCE you know the outside internet address of your home router. Be aware though - opening ports through your router exposes you to some hacker risks.
Go into the linino or arduino Luci shell using your browser, go to the network tab, to the firewall tab and "accept" both input and output on the LAN. Hit save and apply. Go to the network tab, interfaces, hit "edit" on LAN, a new page will appear, change the protocol to "static", create a local network address for the yun like "192.168.1.150" with a netmask of 255.255.255.0 and type in the default gateway address that you learned above, leave "broadcast" blank and hit "save and apply"
Call your internet provider tech support and have them give you a static port for your router. The first couple of DDEs (deliberately dumb employees) won't know what that is and you will need to insist on moving up the supervisor chain until you find somebody who can do it. This may take hours or days. They should do it for free.
Now you will need two programs. "PUTTY" and "Filezilla". Download them. They are free.
Use Filezilla and access your Yun from inside your network first, using its internal static address. - fill in the username and your password for the Yun. Explore the Linux file system with your windows computer to get used to how the program works. Watch out, if you signed in as root you can do damage by deleting files. Now use an external computer (or use your iPhone hotspot instead of your home wifi) and use the external router static IP address to see if you can access the Yun with Filezilla from the outside. Troubleshoot as needed. If the Yun is listening for port 22/23 and if the router is forwarding port 22/23, it will work. So now you can write and read Yun files from the outside using drag and drop into the Filezilla program. Put a picture of your dog onto the Yun. Good boy.
You need PUTTY to get in to the Linux shell. Type in the IP address (either the internal router static address if you are on your home router, or the external static IP address of your router if you are on the outside) and port 22. A shell will pop up, you will enter your username (root) and password and you are the in a user shell for the Linux system. "Reboot" reboots the whole thing, "reset-mcu" resets the program without resetting the linux side. You are almost there.
So how do you put in a new arduino program from outside the local network since the Arduino web feature for doing this does not work? It is cludgey, but after doing it for a while it only takes a minute.
On your Windows Arduino IDE preferences change the IDE to go to "verbose output"
Compile and save the sketch on the IDE
the last line or 2 of the output (the stuff you usually ignore at the bottom) will tell you where the IDE is stashing the hex file
find it using file explorer - In my case it's in the NEWEST hex file folder at C:\Users\micha\AppData\Local\Temp\
Sort them in order of last modified - my most recent one was in a folder called "arduino_build_974710" for example. It has the date and time in file explorer to help you identify it.
arduino_build_974710\scratchpad.ino.with_bootloader.hex was the one I just used, for example
you want to use the hex file that has had the bootloader added to it.
Using file explorer, copy this hex file to another arbitrary folder on your desktop
use filezilla to copy the hex file to the /etc folder on the Yun (but it could go anywhere on the Yun as long as you know where it is)
Go into putty, open the shell and then from any directory that you are in, enter
" run-avrdude /etc/whateveryourhexfileiscalled.withbootloader.hex "
( run-avrdude /etc/scratchpad.ino.with_bootloader.hex) in my case was the last hex file I compiled.
HOLY CRAP - it actually works.
Of course, your mileage may vary. I am so tired of reading wrong advice on these forums, but like I said, this works for me. Good luck.