Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reneluria/tupeuxpasvpn
on demand vpn endpoint using ansible, amazon and sshuttle
https://github.com/reneluria/tupeuxpasvpn
ansible ssh sshuttle tupeuxpastest vpn
Last synced: about 1 month ago
JSON representation
on demand vpn endpoint using ansible, amazon and sshuttle
- Host: GitHub
- URL: https://github.com/reneluria/tupeuxpasvpn
- Owner: reneluria
- License: bsd-3-clause
- Created: 2019-04-08T22:41:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-08T01:16:37.000Z (almost 2 years ago)
- Last Synced: 2024-11-08T02:22:12.421Z (3 months ago)
- Topics: ansible, ssh, sshuttle, tupeuxpastest, vpn
- Language: Shell
- Size: 62.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
TuPeuxPasVPN
============On-demand ansible provided VPN endpoint, using aws ec2 and sshuttle
Dependencies
------------* ansible https://docs.ansible.com/
* boto https://pypi.org/project/boto/
* ssh
* sshuttle https://github.com/sshuttle/sshuttleInstallation
------------Nothing to install if deps are already met.
Otherwise:
```
pipenv shell
```or
```
python3 -m venv venv
. venv/bin/activate
python3 -m pip install -U pip wheel
python3 -m pip install -r requirements.txt
```Usage
-----To create an ssh endpoint in London:
```
SSH_AUTH_SOCK= ansible-playbook create-instance.yml -e 'region=eu-west-2'
```It creates a vm in the given ec2 region and adds it to inventory.
It also creates a helper script in `artifacts` folder.
Launch VPN like this:
```
./artifacts/start-vpn.sh
```And in another terminal you can check where you apparently are:
```
$ curl ipinfo.io
{
"ip": "3.8.174.42",
"hostname": "ec2-3-8-174-42.eu-west-2.compute.amazonaws.com",
"city": "London",
"region": "London, City of",
"country": "GB",
"loc": "51.5115,-0.0912",
"postal": "EC4R",
"org": "AS16509 Amazon.com, Inc."
}
```And remove this instance when you're done:
```
ansible-playbook delete-instance.yml -e 'region=eu-west-2'
```Notes
-----* This recipe generates a ssh keypair for this purpose
* The VM is created with a security group allowing only your public ip to connect to it
* You need to set your aws cli config or EC2_ACCESS_KEY and EC2_SECRET_KEY variables
* Feel free to adapt the template of the vpn script to make it less verbose and daemonize for example
Author
------Rene Luria