I have a remote server that I usually connect to with ssh and upon connection byobu starts automatically (via a line in .profile set up with the script
byobu-enable). Now I want to set up a different workflow for when I connect to the same server to use remote jupyter notebooks. I'd like the remote server start up jupyter and then have ssh forward the
jupyter port to my client machine. I added this to my local .ssh/config
Host remote-server-jupyter HostName 22.214.171.1249 User pgcudahy LocalForward 8889 localhost:8889 ServerAliveInterval 30 ServerAliveCountMax 3 RemoteCommand cd ~/Projects && jupyter notebook --no-browser --port=8889
The problem is that "RemoteCommand" interferes with byobu startup so that after connecting and running the command I'm left with a plain text shell and not a pretty multiplex screen. How can I get both byobu and remote commands on connection?
A big thing is that I don't want these commands to run on every connection, only if I specify that I want a certain workflow. Obviously I can connect to byobu and then run a script on the server to set up my workspace, but I'd like to wrap this all up into one automated command from the client. Even better would be to have separate profiles that not only run custom commands but set up a custom byobu workspace with multiple windows and different commands in each window.