tmate
Overview
The tmate
command is a terminal sharing tool based on tmux. It allows instant terminal sharing over SSH with automatic server provisioning.
Syntax
tmate [options] [command]
Common Options
Option | Description |
---|---|
-S socket |
Socket path |
-V |
Show version |
-v |
Increase verbosity |
-F |
Foreground mode |
-k |
SSH key path |
-n name |
Session name |
-r |
Read-only mode |
-h |
Show help |
--host |
Custom host |
--port |
Custom port |
--api-key |
API key |
Key Bindings
Command | Action |
---|---|
Ctrl-b d |
Detach session |
Ctrl-b c |
New window |
Ctrl-b n |
Next window |
Ctrl-b p |
Previous window |
Ctrl-b % |
Split vertical |
Ctrl-b " |
Split horizontal |
Ctrl-b x |
Kill pane |
Ctrl-b ? |
Show help |
Ctrl-b : |
Command mode |
Ctrl-b [ |
Copy mode |
Key Use Cases
- Remote support
- Pair programming
- Training sessions
- Collaboration
- Remote access
Examples with Explanations
Example 1: Start Session
tmate
Start sharing session
Example 2: Named Session
tmate -n mysession
Create named session
Example 3: Read-only
tmate -r
Start read-only session
Common Usage Patterns
Basic sharing:
tmate show-messages
Custom server:
tmate -h host.example.com
SSH config:
tmate -k ~/.ssh/id_rsa
Security Considerations
- SSH security
- Session access
- Read-only mode
- Server trust
- Key management
Additional Resources
Best Practices
- Verify connections
- Use read-only
- Monitor sessions
- Secure keys
- Clean up
Configuration
- SSH keys
- Custom server
- Session options
- Access control
- Logging
Troubleshooting
- Connection issues
- Key problems
- Server errors
- Permission denied
- Display problems