>       # Attempt to adjust value, should string be present
>       grep -q ^PermitEmptyPasswords /etc/ssh/sshd_config && \
>         sed -i "s/PermitEmptyPasswords.*/PermitEmptyPasswords no/g" 
> /etc/ssh/sshd_config
>       if ! [ $? -eq 0 ]; then
>               # string not present, check for Match stanza
>               grep -q ^Match /etc/ssh/sshd_config && \
>                       sed '0,/.*Match.*/s/.*Match*./PermitEmptyPasswords 
> no\n&/' /etc/ssh/sshd_config
>               if ! [ $? -eq 0 ]; then
>                       # Match stanza not present, add to bottom of 
> /etc/ssh/sshd_config
>                       echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config
>               fi
>       fi


- sed '0,/.*Match.*/s/.*Match*./PermitEmptyPasswords no\n&/' 
/etc/ssh/sshd_config
+ sed -i '0,/.*Match.*/s/.*Match*./PermitEmptyPasswords no\n&/' 
/etc/ssh/sshd_config

Sorry I don't have a great cleanup of that, but gotta add the '-i'  :)
_______________________________________________
scap-security-guide mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/scap-security-guide

Reply via email to