cloudtools / cloudtools/ssh-ca
Unclear failure from ssh-keygen
- Vorherrschende Sprache
- Python
- Sterne
- 261
- Forks
- 22
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I forgot to throw a + in front of the time when signing a key and it caused the ssh-keygen command to fail with this output:
Invalid certificate life specification 4h
Unfortunately you don't see that from ssh-ca - instead you get a mostly unhelpful exception:
```
Invalid certificate life specification 4h
Traceback (most recent call last):
File "/usr/local/bin/sign_key", line 5, in
pkg_resources.run_script('ssh-ca==0.1.0', 'sign_key')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 489, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1214, in run_script
exec script_code in namespace, namespace
File "/Library/Python/2.7/site-packages/ssh_ca-0.1.0-py2.7.egg/EGG-INFO/scripts/sign_key", line 125, in
File "build/bdist.macosx-10.9-intel/egg/ssh_ca/__init__.py", line 55, in sign_public_key
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 575, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['ssh-keygen', '-z', '259', '-s', '/Users/mike/.ssh/ssh_ca_stage', '-I', 'nitin@brkt.com', '-V', '4h', '-n', 'ubuntu,ec2-user', '/var/folders/57/m5_p33bx2cn75pyr8s4_c9040000gn/T/tmpyItSVz']' returned non-zero exit status 255
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Inspect ssh_ca/__init__.py around line 55 and the sign_key script around line 125, where the ssh-keygen subprocess is invoked. Reproduce the command with the shown -V 4h input and compare its stderr and return handling; done means the CLI reports the underlying ssh-keygen failure without the unhelpful traceback.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- cli
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100