How to copy a firmware when ssh and telnet is blocked?

How do I copy a firmware of my router when the access to ssh and telnet is blocked? Dropbear isn’t running. Can I copy it with a USB to TTL ?

what do you mean “copy a firmware”?

do you mean “copy the firmware bin file to the router, then upgrade the firmware”? If yes, then the answer is yes. You can use a USB disk, copy the file to /tmp/

For example, when the file is copied to /tmp/firmware.bin, use

sysupgrade [-n -c] /tmp/firmware.bin

Maybe you want to read this first to have some options to recover your device?: 404 Page not found - GL.iNet

When you backup a custom firmware you execute this command:

cat /dev/mtd5 > /tmp/backup.bin

and you can use scp to copy that backup to your computer, my question is what if the ssh and telnet access to my router is blocked, how can I backup my custom firmware?

Have you tried the Udisk ? The USB port is open,maybe you can try it.Good luck.

cat /dev/mtd5 > /<path-to-your-usb-drive>/backup.bin

would be nice to have a button for this in the OpenWRT GUI to make clones

Yeah,it’s a good idea.