Hello SSH
The SSH (Secure Shell) is a widely used protocol that helps you drop into a remote system, do what you want to do, and get out...
For further actions, you may consider blocking this person and/or reporting abuse
I use 'mosh' for UDP based ssh, this allows me to have a persistent ssh to a host where I then launching my tmux sessions. Now if my connection falters (laptop WiFi/wired or otherwise) my ssh stays up and my tmux sessions are safe on the host.
This is something I've been trying to do too, however I couldn't get your method to work on my setup (LXC containers inside Proxmox). It wouldn't create the initial tmux session.
However, I found this Stack Overflow question which has a useful answer:
stackoverflow.com/questions/343253...
Putting
tmux new -A -s mySessionin my .profile works.I'm also using mosh to persist the connection when my PC goes to sleep.
I was getting
sessions should be nested with care, unset $TMUX to forceat the top of tmux when usingtmux attach || tmux new. What happens is tmux also executes .bashrc/profile.So now I use this:
if [[ ! "$TERM" =~ "screen" ]]; thentmux attach -t default || tmux new -s default
fi
in my .bashrc
TERM is set to 'screen' in tmux environment.
Glad you got it to work, also, I've only heard praises for mosh. I should take it for a spin one of these days.
Turn on keepalives in ssh config...
autossh -M 0 -t user@host tmux new -s sessname -A
This allows me to roam across networks and seemlessly reconnect if the connection fails.
It works on my 120mile commute across multiple networks flawlessly... and across laptop sleeps.
Same here. I also use tmuxinator which is just awesome!
Just like screen?
Yeah, though I personally prefer tmux to screen.