Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Suggestion for your bash_login or equivalent, to automatically get back your session based on the IP you connect from (6to4 safe):

REMOTEIP=`echo $SSH_CONNECTION |sed -e 's/::ffff://g' -e 's/ .*//g'`

if [ -z "$SSH_CONNECTION" ]; then if [ "$TERM" != "tmux" ]; then tmux attach -t $REMOTEIP || tmux new -s $REMOTEIP ; fi ; fi

I have static IPs and I like to come back to a server the way I left it the day before, from home or work.

For pratical reasons (everything in one window), I often have tmux running inside GNU screen, with one GNU screen per remote server.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: