I have been reading about how to automatically start a screen when I
ssh to a remote server. I would like a simple one-liner to add to my
.bash_profile to start
screen when I
ssh in, and NOT exit my remote connection when I detach the screen.
I have been looking into
exec screen and pretty much every combination of
-R and cannot figure out what flags I need.
Ideally I would type
ssh whatever and be logged into the server in a new
screen or it can reattach an old screen, I would kind of like to know how to do both to see which I like better. Then I can either type Ctrl ad or Ctrl d and have it bring me back to the normal
ssh login for that server (where you would see the motd). From there I can
screen -r back into whatever screen I want, or hit Ctrl d again to log out.