tg is a Python TUI based SSH connection manager that integrates seamlessly with your existing SSH configuration.
https://pypi.org/project/tengingarstjori/
- Python 90.5%
- Shell 9.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| docs | ||
| scripts | ||
| src/tengingarstjori | ||
| tests | ||
| .gitignore | ||
| CLAUDE.md | ||
| install.sh | ||
| LICENSE | ||
| main.py | ||
| MANIFEST.in | ||
| pre_commit_tests.sh | ||
| pyproject.toml | ||
| pytest.ini | ||
| README.md | ||
| requirements.txt | ||
| security_best_practices_report.md | ||
| uv.lock | ||
Tengingarstjóri(tg) - SSH Connection Manager
Tengingarstjóri (tg) is a Python TUI based SSH connection manager that integrates seamlessly with your existing SSH configuration. Shortened to tg for ease of use, the app was born when my previous tool was deprecated and I wanted to learn how pypi and python packaging worked.
Installation
From PyPI (Recommended)
pip install tengingarstjori
From Source
git clone https://github.com/greyhoundforty/tengingarstjori.git
cd tengingarstjori
pip install -e .
Features
- Full SSH Connection Management: Add, update, clone, and remove connections
- Flexible List Views: Table, compact, and JSON formats with tag/search/sort filtering
- Quick Connect:
tg connect <name>launches SSH and tracks usage stats - ProxyJump Support: Seamless bastion host and jump server configuration
- Port Forwarding: Local and remote port forwarding with auto-corrected syntax
- Non-invasive SSH Config Integration: Preserves your existing setup
- Export / Import: Backup and restore connections as JSON or SSH config format
- History & Health Checks:
tg historyandtg testfor usage tracking and connectivity
Demo
Quick Start
# Initialize Tengingarstjóri (tg)
tg init
# Add your first connection
tg add -n web-server -h 192.168.1.100 -u admin
# List connections
tg list
# Connect
tg connect web-server
# Or use SSH directly (tg manages the config)
ssh web-server
Architecture
Rather than modifying your main SSH config directly, Tengingarstjóri will:
- Create a managed config file:
~/.ssh/config.tengingarstjori - Add a single line to main config to include our new file:
Include ~/.ssh/config.tengingarstjori - Manage connections separately: All additions/changes go to the managed file
- Preserve your existing SSH setup: Your existing SSH config remains untouched
Security
Tengingarstjóri is designed to handle sensitive SSH configuration safely:
- Restricted file permissions:
connections.json,~/.ssh/config.tengingarstjori, and the~/.tengingarstjori/config directory are created with0600/0700permissions atomically — there is no window where files are world-readable. - SSH config injection prevention: All user-supplied fields (
name,host,user,identity_file,proxy_jump,extra_options) are validated to reject newline characters before being written into the SSH config. Notes have newlines stripped. This prevents crafted values from injecting arbitrary SSH config directives. - Non-destructive config management: Only a single
Includeline is added to your main~/.ssh/config. All managed connections live in a separate file that can be inspected, backed up, or removed independently. - Backup before changes: A backup of your main SSH config is created at
~/.ssh/config.backupbefore any modification.
Usage Examples
See the wiki for CLI examples, configuration options, and local development guidance.
Contributing
- See DEVELOPMENT.md for local testing guidance
- Ensure all tests pass:
mise run test - Check code quality:
mise run lint - Run full validation:
mise run validate - Update documentation as needed
License
This project is licensed under the MIT License - see the LICENSE file for details.