I f-ed up my .bashrc on a remote server and couldn't log in since ssh always starts bash before doing anything else.
I tried everything... ssh -t, scp, sshfs, sftp, but nothing worked...
I thought I was going to have to contact the server admin to get it fixed. But then by chance I stumbled across this brilliant idea: https://serverfault.com/a/237481
It took a few tries to get the timing right, but pressing Ctrl-C *just* as you log in actually works!
@a instead of logging in interactively, you can also follow the ssh command with commands you want to run on the remote server.
@corburn the problem is that ssh starts the bash shell before running any other commands, so that idea doesn't work
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!