Set up forwarding so you can connect via a bastion host.
For example to set up ssh:
Or to set up psql:
To set up your own private ngrok (forwarding requests to a remote host to your local host):
You will need to set GatewayPorts to yes in the sshd_config.
If you only need to bind to the remote machine's localhost, this is safer:
This will listen on example.com:3001 and forward requests to 127.0.0.1:3000 (where 127.0.0.1 is your local client machine).
To load an ssh key into your current bash session:
To run just one command with a given ssh key:
On my Xubuntu desktop, ssh-agent starts automatically only when you login at the console. If you login remotely, you need to say this:
If you too much ssh keys in your ssh agent:
To just use a password: