2.3 KiB
To optimize your tmux workflow for managing SSH sessions to your two Proxmox servers and your personal workstation, you can set up a tmux session that allows you to easily switch between these environments. Here’s a step-by-step guide to get you started:
1. Starting and Naming a tmux Session
Open your terminal and start a new tmux session named, for example, "Proxmox":
tmux new-session -s Proxmox
2. Creating Windows for Each Server
Once inside the tmux session, you can create a new window for each Proxmox server and your workstation:
-
Create the first window for Proxmox Server 1:
Ctrl + b, c # This creates a new window ssh user@proxmox1 # Replace with your actual SSH command -
Rename the window for clarity:
Ctrl + b, , # Press comma to rename the current window Proxmox1 # Type the new name and press Enter -
Repeat for Proxmox Server 2 and your personal workstation: Do the same as above but adjust the SSH command and window name accordingly.
3. Switching Between Windows
To switch between your windows easily:
- Next window:
Ctrl + b, n— Moves to the next window. - Previous window:
Ctrl + b, p— Moves to the previous window. - Select window by number:
Ctrl + b, 0 (or 1, 2,...)— Each window is numbered starting from 0, press the corresponding number to switch.
4. Splitting Windows
If you want to view multiple sessions side-by-side within the same window:
- Vertical split:
Ctrl + b, %— Splits the window vertically. - Horizontal split:
Ctrl + b, "— Splits the window horizontally. - Switch between panes:
Ctrl + b, arrow keys— Use arrow keys to move between split panes.
5. Detaching and Attaching
You can detach from the tmux session and leave all sessions running in the background:
- Detach:
Ctrl + b, d— Detaches from the tmux session. - Attach to an existing session:
tmux attach -t Proxmox— Re-attaches to the session.
This setup allows you to maintain persistent connections to each server and your workstation, quickly switch between them, and even monitor multiple servers side-by-side if needed. If you have specific tmux preferences or additional requirements, you can customize further with tmux configuration options.