brokenkeys.sh 461 B

1234567891011121314151617181920212223
  1. # $OpenBSD: brokenkeys.sh,v 1.2 2017/04/30 23:34:55 djm Exp $
  2. # Placed in the Public Domain.
  3. tid="broken keys"
  4. KEYS="$OBJ/authorized_keys_${USER}"
  5. start_sshd
  6. mv ${KEYS} ${KEYS}.bak
  7. # Truncated key
  8. echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEABTM= bad key" > $KEYS
  9. cat ${KEYS}.bak >> ${KEYS}
  10. cat $OBJ/$t.pub >> $OBJ/authorized_keys_$USER
  11. ${SSH} -F $OBJ/ssh_config somehost true
  12. if [ $? -ne 0 ]; then
  13. fail "ssh connect with failed"
  14. fi
  15. mv ${KEYS}.bak ${KEYS}