djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 1 | # $OpenBSD: brokenkeys.sh,v 1.2 2017/04/30 23:34:55 djm Exp $ |
Darren Tucker | 124f58e | 2004-12-06 23:07:37 +1100 | [diff] [blame] | 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="broken keys" |
| 5 | |
| 6 | KEYS="$OBJ/authorized_keys_${USER}" |
| 7 | |
| 8 | start_sshd |
| 9 | |
| 10 | mv ${KEYS} ${KEYS}.bak |
| 11 | |
| 12 | # Truncated key |
| 13 | echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEABTM= bad key" > $KEYS |
| 14 | cat ${KEYS}.bak >> ${KEYS} |
| 15 | cat $OBJ/$t.pub >> $OBJ/authorized_keys_$USER |
| 16 | |
djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 17 | ${SSH} -F $OBJ/ssh_config somehost true |
Darren Tucker | 124f58e | 2004-12-06 23:07:37 +1100 | [diff] [blame] | 18 | if [ $? -ne 0 ]; then |
djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 19 | fail "ssh connect with failed" |
Darren Tucker | 124f58e | 2004-12-06 23:07:37 +1100 | [diff] [blame] | 20 | fi |
| 21 | |
| 22 | mv ${KEYS}.bak ${KEYS} |
| 23 | |