top | item 32501561

(no title)

olifante | 3 years ago

How about SSH straight into screen?

Here's how to define a shell function for quickly attaching to an existing screen session after connecting via ssh (or creating a new one if none exists):

  sshcreen () {
      ssh -t "$@" screen -xRR
  }
Works with bash and zsh. Usage is pretty simple:

  $ sshcreen user@example.com
You can use normal ssh arguments, such as the port:

  $ sshcreen root@localhost -p 2222
Detach the session with CTRL-A + D, reattach by re-running the sshcreen command you previously used.

PS: repurposed my comment from a recent discussion: https://news.ycombinator.com/item?id=32486892

discuss

order

No comments yet.