{"id":16607421,"url":"https://github.com/dimon222/py-vmsshgen","last_synced_at":"2025-06-12T11:34:31.331Z","repository":{"id":62587715,"uuid":"309233924","full_name":"dimon222/py-vmsshgen","owner":"dimon222","description":"Automatic generation of SSH keys for VM","archived":false,"fork":false,"pushed_at":"2023-03-27T00:11:39.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T21:17:56.326Z","etag":null,"topics":["automation","hacktoberfest","python","security","ssh"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimon222.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-02T02:12:29.000Z","updated_at":"2024-12-19T12:18:48.000Z","dependencies_parsed_at":"2025-01-17T12:13:28.615Z","dependency_job_id":"944dd7b6-5b5e-4e1b-84bf-71918e8dca6c","html_url":"https://github.com/dimon222/py-vmsshgen","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimon222%2Fpy-vmsshgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimon222%2Fpy-vmsshgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimon222%2Fpy-vmsshgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimon222%2Fpy-vmsshgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimon222","download_url":"https://codeload.github.com/dimon222/py-vmsshgen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242774424,"owners_count":20183077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","hacktoberfest","python","security","ssh"],"created_at":"2024-10-12T01:13:40.024Z","updated_at":"2025-03-10T01:36:27.703Z","avatar_url":"https://github.com/dimon222.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# py-vmsshgen\nAutomatic generation of SSH keys for VM.\n\n## Why?\nI got tired of provisioning SSH keys manually between hundreds of VMs that I had to use.\n\n## How to use?\nThe script generates OpenSSH keypair and pushes public key to VM using existing SSH connection that can be protected by password (or some another SSH key). The private key on client machine (that executes this application) automatically goes to `~/.ssh/{name}.pem` + reference to it is appended to `~/.ssh/config` for automatic pickup by SSH client configuration.\n\nSupported parameters for key generation - https://asyncssh.readthedocs.io/en/latest/api.html#asyncssh.generate_private_key   \nSupported parameters for private key export - https://asyncssh.readthedocs.io/en/latest/api.html#asyncssh.SSHKey.export_private_key\n\nDefault settings:\n* Algo for generation - ssh-ed25519\n* No passphrase\n* Output private key with cipher AES256 with SHA256 hashing and 128 rounds of bcrypt.\n\nYou can install it using pip  \n`pip install vmsshgen`\n\nAll actions are done interactively in terminal:  \n```\nusage: vmsshgen [-h] [-n N] [-a ALGO] [-ks KEY_SIZE] [-e EXPONENT] [-p PASSPHRASE] [-c CIPHER] [-r ROUNDS] [-hn HASH_NAME] host {password,privatekey} username pf\n\npositional arguments:\n  host                  VM hostname:port (example localhost:22)\n  {password,privatekey}\n                        login type\n  username              VM username\n  pf                    Password file location\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -n N, --name N        name for public/private key\n  -a ALGO, --algorithm ALGO\n                        algorithm for keypair (default is ssh-ed25519)\n  -ks KEY_SIZE, --key-size KEY_SIZE\n                        key size (only for RSA)\n  -e EXPONENT, --exponent EXPONENT\n                        exponent (only for RSA)\n  -p PASSPHRASE, --passphrase PASSPHRASE\n                        passphrase for OpenSSH key (default is None)\n  -c CIPHER, --cipher CIPHER\n                        cipher for OpenSSH key (default is aes256)\n  -r ROUNDS, --rounds ROUNDS\n                        rounds for OpenSSH key (default is 128)\n  -hn HASH_NAME, --hash-name HASH_NAME\n                        hash name for OpenSSH key (default is sha256)\n```\n\nExample with password file on [linuxserver.io](https://hub.docker.com/r/linuxserver/openssh-server) with password `password` stored in file named `pf`:  \n`vmsshgen -n test localhost:2222 password linuxserver.io pf`\n\nOf course, if you want to supply password right inside of same commandline statement, there's an option using FIFO pipe:  \n` vmsshgen -n test localhost:2222 password linuxserver.io \u003c(echo 'password')`\n\n(Honestly, if you decided to go with this option, I suggest to  ensure that history for current shell is disabled or you enter `space` in front of command to avoid leaking password in history)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimon222%2Fpy-vmsshgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimon222%2Fpy-vmsshgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimon222%2Fpy-vmsshgen/lists"}