linux - Sanity check SSH public key? -
i have asked users public "id_rsa.pub" ssh key, place in "/home/theiraccount/.ssh/authorized_keys", can login server ssh. i'd automate process.
is there anyway sanity check string give me (programmatically or otherwise)? want verify sshd can read text , looks valid public key (and hasn't been corrupted)?
put way, format of id_rsa.pub
file? if enters in field can write in form handler script verify complete , correct?
ssh-keygen
can used calculate fingerprint of key file, fail if don't pass key:
ssh-keygen -l -f id_rsa.pub
another possibility ssh-vulnkey
, have advantage of checking keys against blacklist of known compromised keys @ same time.
Comments
Post a Comment