瀏覽代碼

systemd style

Bob Mottram 9 年之前
父節點
當前提交
d0f330d9da
共有 2 個檔案被更改,包括 5 行新增5 行删除
  1. 1
    1
      src/freedombone
  2. 4
    4
      src/freedombone-sec

+ 1
- 1
src/freedombone 查看文件

292
 SSL_PROTOCOLS="TLSv1 TLSv1.1 TLSv1.2"
292
 SSL_PROTOCOLS="TLSv1 TLSv1.1 TLSv1.2"
293
 
293
 
294
 # list of ciphers to use.  See bettercrypto.org recommendations
294
 # list of ciphers to use.  See bettercrypto.org recommendations
295
-SSL_CIPHERS='EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA256:EECDH:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!IDEA:!ECDSA:kEDH:CAMELLIA128-SHA:AES128-SHA'
295
+SSL_CIPHERS="EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA256:EECDH:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!IDEA:!ECDSA:kEDH:CAMELLIA128-SHA:AES128-SHA"
296
 
296
 
297
 # ssh (from https://stribika.github.io/2015/01/04/secure-secure-shell.html)
297
 # ssh (from https://stribika.github.io/2015/01/04/secure-secure-shell.html)
298
 SSH_CIPHERS="chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr"
298
 SSH_CIPHERS="chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr"

+ 4
- 4
src/freedombone-sec 查看文件

156
       sed -i "s|ssl_protocols .*|ssl_protocols $SSL_PROTOCOLS;|g" $WEBSITES_DIRECTORY/$file
156
       sed -i "s|ssl_protocols .*|ssl_protocols $SSL_PROTOCOLS;|g" $WEBSITES_DIRECTORY/$file
157
       sed -i "s|ssl_ciphers .*|ssl_ciphers '$SSL_CIPHERS';|g" $WEBSITES_DIRECTORY/$file
157
       sed -i "s|ssl_ciphers .*|ssl_ciphers '$SSL_CIPHERS';|g" $WEBSITES_DIRECTORY/$file
158
   done
158
   done
159
-  service nginx restart
159
+  systemctl restart nginx
160
   echo $'Web security settings changed'
160
   echo $'Web security settings changed'
161
 }
161
 }
162
 
162
 
172
   fi
172
   fi
173
   sed -i "s|ssl_cipher_list.*|ssl_cipher_list = '$SSL_CIPHERS'|g" $DOVECOT_CIPHERS
173
   sed -i "s|ssl_cipher_list.*|ssl_cipher_list = '$SSL_CIPHERS'|g" $DOVECOT_CIPHERS
174
   sed -i "s|ssl_protocols.*|ssl_protocols = '$SSL_PROTOCOLS'|g" $DOVECOT_CIPHERS
174
   sed -i "s|ssl_protocols.*|ssl_protocols = '$SSL_PROTOCOLS'|g" $DOVECOT_CIPHERS
175
-  service dovecot restart
175
+  systemctl restart dovecot
176
   echo $'imap security settings changed'
176
   echo $'imap security settings changed'
177
 }
177
 }
178
 
178
 
201
       sed -i "s|MACs .*|MACs $SSH_MACS|g" $SSH_CONFIG
201
       sed -i "s|MACs .*|MACs $SSH_MACS|g" $SSH_CONFIG
202
       sed -i "s|KexAlgorithms .*|KexAlgorithms $SSH_KEX|g" $SSH_CONFIG
202
       sed -i "s|KexAlgorithms .*|KexAlgorithms $SSH_KEX|g" $SSH_CONFIG
203
       sed -i "s|PasswordAuthentication .*|PasswordAuthentication $SSH_PASSWORDS|g" $SSH_CONFIG
203
       sed -i "s|PasswordAuthentication .*|PasswordAuthentication $SSH_PASSWORDS|g" $SSH_CONFIG
204
-      service ssh restart
204
+      systemctl restart ssh
205
       echo $'ssh server security settings changed'
205
       echo $'ssh server security settings changed'
206
   fi
206
   fi
207
 }
207
 }
218
   fi
218
   fi
219
   sed -i "s|ciphers =.*|ciphers = \"$XMPP_CIPHERS\";|g" $XMPP_CONFIG
219
   sed -i "s|ciphers =.*|ciphers = \"$XMPP_CIPHERS\";|g" $XMPP_CONFIG
220
   sed -i "s|curve =.*|curve = \"$XMPP_ECC_CURVE\";|g" $XMPP_CONFIG
220
   sed -i "s|curve =.*|curve = \"$XMPP_ECC_CURVE\";|g" $XMPP_CONFIG
221
-  service prosody restart
221
+  systemctl restart prosody
222
   echo $'xmpp security settings changed'
222
   echo $'xmpp security settings changed'
223
 }
223
 }
224
 
224