aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2017-12-05 09:08:48 +0000
committerColin Percival <cperciva@FreeBSD.org>2017-12-05 09:08:48 +0000
commit4ba35bc4dbbc2b69c7afc2b86c011d450ca81fc7 (patch)
tree3e8cbf3fea074dc1aed3317f47fcd403837abb92
parentbe28698cf226998a1f3e91f5ca6075b6fd54de08 (diff)
downloadsrc-4ba35bc4dbbc2b69c7afc2b86c011d450ca81fc7.tar.gz
src-4ba35bc4dbbc2b69c7afc2b86c011d450ca81fc7.zip
Resurrect r321659: Turn off ChallengeResponseAuthentication for EC2 AMIs.
EC2 instances are normally launched with an SSH public key specified, which is then used for logging in (by default, as 'ec2-user'). Having ChallengeResponseAuthentication enabled (as FreeBSD's default sshd_config does) has no functional effect in a new EC2 instance, since you can't log in using a password until a password has been set -- but having this enabled results in alerts from automated scanning tools which can detect that sshd advertises support for keyboard-interactive logins (since they can't detect that accounts have no password set). EC2 users who want to use passwords to log in to their instances will need to set 'ChallengeResponseAuthentication yes' in FreeBSD 12.0 and later. Discussed with: gjb, gtetlow, emaste, des Requested by: Amazon X-MFC: No Relnotes: ChallengeResponseAuthentication is turned off by default in Amazon EC2 AMIs.
Notes
Notes: svn path=/head/; revision=326564
-rw-r--r--release/tools/ec2.conf6
1 files changed, 6 insertions, 0 deletions
diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf
index e688b6a3d9ff..e712395da481 100644
--- a/release/tools/ec2.conf
+++ b/release/tools/ec2.conf
@@ -81,6 +81,12 @@ vm_extra_pre_umount() {
# Load the kernel module for the Amazon "Elastic Network Adapter"
echo 'if_ena_load="YES"' >> ${DESTDIR}/boot/loader.conf
+ # Disable ChallengeResponseAuthentication according to EC2
+ # requirements.
+ sed -i '' -e \
+ 's/^#ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/' \
+ ${DESTDIR}/etc/ssh/sshd_config
+
# The first time the AMI boots, the installed "first boot" scripts
# should be allowed to run:
# * ec2_configinit (download and process EC2 user-data)