https://github.com/alexejk/portal
Quickly connect to and manage SSH favorite connections from CLI
https://github.com/alexejk/portal
aws cli go ssh
Last synced: 6 months ago
JSON representation
Quickly connect to and manage SSH favorite connections from CLI
- Host: GitHub
- URL: https://github.com/alexejk/portal
- Owner: alexejk
- License: mit
- Created: 2019-12-26T16:55:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-03T04:59:25.000Z (about 3 years ago)
- Last Synced: 2025-10-05T11:49:26.778Z (9 months ago)
- Topics: aws, cli, go, ssh
- Language: Go
- Homepage:
- Size: 88.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Portal

[](https://goreportcard.com/report/alexejk.io/portal)


Simple tool to quickly connect to favorite servers, including creation of SSH tunnels.
## Status
This project is very much in it's initial, **experimental** phase. Use at your own risk.
## Features
Portal provides following set of features that one could find useful:
* Bookmark-like feature for SSH connections - simply run `portal connect `
* Support for complex connections such as multi-hop SSH tunnels
* Support for connections with AWS EC2 Instance Connect by temporarily pushing SSH key to the instance
* Provides (potentially )useful hints upon established connection, e.g what ports are being forwarded
## Usage
### Configuration
Configuration file is looked for at `~/.portal/config.yaml`.
```yaml
---
debug: false
default-public-key: ~/.ssh/id_rsa.pub
default-private-key: ~/.ssh/id_rsa
# List of all known destinations
portals:
# Tunnel
- name: server1.tunnel
hint: Port 3000
raw:
command: ssh -L 3000:localhost:8080 me@server1.dot.ip
# Direct connection
- name: server.prod.bastion
raw:
command: ssh -A user@bastion.dot.ip
# Double tunnel
- name: server.prod.tunnel
hint: Local 33333 -> 12345 @ backend.dot.ip via bastion.dot.ip
raw:
command: ssh -L 33333:localhost:33333 -A user@bastion.dot.ip ssh -L 33333:localhost:12345 -A user@backend.dot.ip
# AWS EC2 Instance Connect
- name: aws.host
aws:
instance-id: i-1234abcd
region: us-west-1
user: ec2-user
```
### Supported Commands
* Get all available connections:
`portal list`
* Connect to a server:
`portal connect ` where `` is the favorite name
## TODOs
See separate [TODO document](TODO.md) for what is planned.
## Building
Simply run `make all` or `make build-in-docker` if you have Docker installed
## License
MIT license, as described in the [LICENSE](LICENSE) file.