Doing ssh without “tmux” is a big pain!

Ali Sepehri
salamcinema
Published in
1 min readJan 21, 2017

tmux’s authors describe it as a terminal multiplexer. I don’t want to say: “What is the tmux?”, you can find the answer with a simple search on the Internet. I want to say how & why I’m using tmux.

Do you have a VPS and do you connect to it with ssh? Has it happened to you that you need to execute a command/script which takes more than 30 minutes? Do you lose what you were doing when your connection gets disconnected? Do you need more than one window on your ssh?
tmux will be your angel.

Let’s go to see how I’m using tmux in my daily scenario:

ssh -i ssh_file username@server_ip############ On the server ############
$ tmux
# ...
# (ctrl b)+c to create new window
# (ctrl b)+p return to previous window
# (ctrl b)+n go to second(next) window
# ctrl+d close second window
# (ctrl b)+d to close tmux session
############ Back to server ############
$ tmux ls
0: 1 windows (created Wed Jan 11 20:43:14 2017) [160x43]
$ tmux attach -t 0
# I have previous session
# press (ctrl b)+d and close session again

It’s straightforward!

--

--