Make that it works in 90% of the cases. 3:30.

This commit is contained in:
2023-03-26 17:37:16 +03:00
parent 55bb5b426d
commit 23022e6d20
2 changed files with 4 additions and 2 deletions

4
harden
View File

@@ -114,7 +114,7 @@ services=()
# The hardenSSH function will use sed to modify the sshd_config file to have the following settings:
# - Allow ssh access to users in the sudo group only
# - Change the port to 22121 if it is available
# - Change the port to 22100 if it is available
# - Configure idle timeout to 5 minutes
# - Limit the number of authentication attempts to 3
# - Disable root login
@@ -134,7 +134,7 @@ function hardenSSH {
if [[ -e /etc/ssh/sshd_config ]] && [[ -r /etc/ssh/sshd_config ]]; then
sed -i \
-e 's/^#AllowGroups.*/AllowGroups sudo/' \
-e 's/^#Port.*/Port 22121/' \
-e 's/^#Port.*/Port 22100/' \
-e 's/^#ClientAliveInterval.*/ClientAliveInterval 300/' \
-e 's/^#ClientAliveCountMax.*/ClientAliveCountMax 3/' \
-e 's/^#PermitRootLogin.*/PermitRootLogin no/' \

View File

@@ -1219,6 +1219,8 @@ def create_node(provider, name=None, location=None, size=None, image=None, confi
print("\nIP: %s" % (node.public_ips[0]))
print("\nssh command: ssh -i %s secdep@%s\n" % (SECDEP_SSH_PRIVATE_KEY, node.public_ips[0]))
print("If you ever change the port adjust the command accordingly")
print("If you used the --deploy flag we changed the port to 22100 so the command is:")
print("\nssh -p 22100 -i %s secdep@%s\n" % (SECDEP_SSH_PRIVATE_KEY, node.public_ips[0]))
return node
def list_all_nodes(provider, filterIn=None, awsRegion=None):