It's not completely clear if you are on a client or on the server so let me try to distinguish.
If you ssh from another machine then input from keystrokes are handled by your SSH terminal application on the client machine, not by anything on the server.
So would be enough to change the keymap on client side like i.e. here.
If Ipad does not allow it I'm afraid you should use another remote terminal or relay on the application you use to remap the keys (if possible). here a quick how-to for vim, emacs has something similar.
For the rest of the answer I'll assume you are logged "on Ubuntu Snap server" not remotely.
There are 2 ways to achieve the same:
- through loadkeys (requires console-data to be installed)
dump the layout of your keyboard:
# dumpkeys >modified.kmap
Modify the layout as needed:
# in your case you should substitute in the modified.kmap
#a not elegant way would be to add at the end of the file:
keycode 1 = Caps_Lock
keycode 58 = Escape
Apply changes
# loadkeys ./modified.kmap
Check changes are in place:
# dumpkeys |grep "Escape"
[...]
keycode 58 = Escape
# dumpkeys |grep "Caps_Lock"
keycode 1 = Caps_Lock
- through a trick with
/etc/default/keyboard
Add the following to your layout in /etc/default/keyboard
XKBOPTIONS="caps:swapescape"
Reconfigure the keyboard through dpkg NB keeping the options (this has to be done also in case your layout is already the correct one)
# dpkg-reconfigure keyboard-configuration
answer yes when you are asked Keep current keyboard options in the configuration file?
Let me know if this was useful.