Problem Scenario
You want to modify a security group to allow SSH connections from an IP address. How do you do this with the AWS CLI?
Solution
You have to know the security group's ID. Replace "sg-abcd1234" with the group ID, and replace 1.2.3.0/24 with the IP address and subnet mask you want to allow to connect from in this command and then run it:
aws ec2 authorize-security-group-ingress \
--group-id sg-abcd1234 \
--protocol tcp \
--port 22 \
--cidr 1.2.3.0/24