Skip to main content

ssh-bastion

SSH proxy server.

Transport ssh connection to other servers.

Based on paramiko👍.

Why

System managers may want to limit access routes to their servers, so this tool can act as a bastion or proxy or whatever-you-call server.

And also if you want the activities of what users did on these servers, the logging function could help.

What can do

  1. Just works as a normal ssh server.
  2. Connect to other ssh servers through this tool.

What can not do

  1. GSSAPI(Kerberos) authentication: Nah...
  2. Port, X11 or any other forwarding: Not the purpose of this project.

Requirements

  • Python: 3.6+
  • OS: Linux
    • PAM module
    • Shell
    • OpenSSH-client (for scp)
    • OpenSSH-server (for sftp)

Installation

pip install ssh-bastion

Usage

To start the server:

ssh-bastion -s

For more information:

ssh-bastion -h

Login

  1. As a normal ssh server, you know how to use it.
  2. As a proxy server:
    • Use username like this: <username of proxy>#<username of target>@<hostname or IP of target>[:<port of target>]
      • You need to use "%" to escape "#", "@", "%" in both usernames.

        For example: A%@very%#strange%%username#%#another%%strange%username@192.168.1.100:2222

        This will connect to 192.168.1.100:2222 with user #another%strangeusername via user A@very#strange%username on proxy server.

    • Use password like this: <password of proxy>#<password of target>
      • Same as username, you need to use "%" to escape "#" in both passwords.
    • When use private key authentication, put the key in ~/.ssh, and name it like this: <username of target>@<hostname or IP of target>[:<port of target>]
      • Use "%" to escape "@" in username.

Still working on😴

  1. Make command line tool.
    1. Start the server.
    2. Set/unset systemd unit file. (Including reload)
    3. Generate default config file.
    4. Show parsed configuration.
  2. PyPI packaglize.
  3. Private key authentication.
  4. Logging.
    1. System log
      1. DEBUG
      2. INFO
      3. WARNING
      4. ERROR
      5. CRITICAL
      6. OFF
    2. Access log
      1. DUMP (file)
      2. INFO
      3. OFF
    3. File (transfer) log
      1. DUMP (file)
      2. INFO
      3. OFF
  5. Configuration file. (Including accesss control)

Vulnerabilities😴

Not yet, will check after all features are done.

Disclaimer

Use at your own risk.

Metadata

Release files for ssh-bastion 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ssh-bastion 0.1.3
File Size Uploaded
ssh_bastion-0.1.3.tar.gz 15.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ssh-bastion 0.1.3
File Interpreter ABI Platform
ssh_bastion-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 30.1 kB

Release files / ssh_bastion-0.1.3.tar.gz

Download URL ssh_bastion-0.1.3.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3c37fbf2f24c995120d66eb313513f6c78c2f592e7c7500f2f3deec11d4ac35b
BLAKE2b-256 checksum
How to use checksums
7cb715d820e864cb90613cbfc644f8220695cf78a3cfb9e1b518e0ad148b0986
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / ssh_bastion-0.1.3-py3-none-any.whl

Download URL ssh_bastion-0.1.3-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63dc8a8892cd5ca9354432fd9c95f71410bd57afb4ea4e527a4eb430d59f95d5
BLAKE2b-256 checksum
How to use checksums
411cda1debf3cbc61bca4e97e786a49dcba54a9986043989a3038d8d6575e203
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page