Skip to content

Commit db530aa

Browse files
authored
Merge pull request #48 from rmarabini/master
fix AuthorizedKeysFile example
2 parents 6b8cf98 + e668205 commit db530aa

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

README.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,11 @@ Parsing of `authorized_keys` files:
6565
::
6666

6767
from sshpubkeys import AuthorizedKeysFile
68+
f = open("/home/username/.ssh/authorized_keys", "r")
69+
key_file = AuthorizedKeysFile(f, strict=False)
6870

69-
key_file = AuthorizedKeysFile("""ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEGODBKRjsFB/1v3pDRGpA6xR+QpOJg9vat0brlbUNDD\n"""
70-
"""#This is a comment\n\n"""
71-
"""ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAF9QpvUneTvt8"""
72-
"""lu0ePSuzr7iLE9ZMPu2DFTmqh7BVn89IHuQ5dfg9pArxfHZWgu9lMdlOykVx0I6OXkE35A/mFqwwApyiPmiwno"""
73-
"""jmRnN//pApl6QQFINHzV/PGOSi599F1Y2tHQwcdb44CPOhkUmHtC9wKazSvw/ivbxNjcMzhhHsWGnA=="""
74-
strict=True, disallow_options=True)
7571
for key in key_file.keys:
76-
print(key.key_type, key.bits, key.hash_512())
72+
print(key.key_type, key.bits, key.comment)
7773

7874

7975
Options

0 commit comments

Comments
 (0)