diff --git a/build-go.sh b/build-go.sh index eadb0f0..a41a0ef 100755 --- a/build-go.sh +++ b/build-go.sh @@ -11,7 +11,7 @@ GITHUB="https://github.com/golang/go/archive/" V14="go1.4.3" TGZ14="${V14}.tar.gz" -Vnew="go1.6.2" +Vnew="go1.7.3" TGZnew="${Vnew}.tar.gz" INSTALL="/usr/local" diff --git a/ssh-config.sh b/ssh-config.sh index 7672527..c5d8b52 100755 --- a/ssh-config.sh +++ b/ssh-config.sh @@ -24,10 +24,16 @@ if [ "${answer}" != "y" ]; then exit 0 fi -if [ -f /etc/ssh/moduli ]; then +ssh_moduli="/etc/ssh/moduli" +moduli="/etc/moduli" +if [ -f ${ssh_moduli} ]; then echo "filtering safe primes" - awk '$5 > 2000' /etc/ssh/moduli > /tmp/moduli - mv /tmp/moduli /etc/ssh/moduli + awk '$5 > 2000' ${ssh_moduli} > /tmp/moduli + mv /tmp/moduli ${ssh_moduli} +elif [ -f ${moduli} ]; then + echo "filtering safe primes" + awk '$5 > 2000' ${moduli} > /tmp/moduli + mv /tmp/moduli ${moduli} else echo "generating safe primes" echo "warning: this can take a long time (2h+)" @@ -52,14 +58,14 @@ if [ -f /etc/ssh/sshd_config ]; then mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak fi -cat << EOF > /etc/ssh/sshd_config +cat < /etc/ssh/sshd_config Port 22 Protocol 2 HostKey /etc/ssh/ssh_host_ed25519_key HostKey /etc/ssh/ssh_host_rsa_key KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256 -Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr -MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com +Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr +MACs umac-128-etm@openssh.com,umac-64-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com UsePrivilegeSeparation sandbox PermitRootLogin no RSAAuthentication no @@ -71,14 +77,14 @@ EOF case ${UNAME} in Linux) - cat << EOF >> /etc/ssh/sshd_config + cat <> /etc/ssh/sshd_config AuthorizedKeysFile %h/.ssh/authorized_keys Subsystem sftp /usr/lib/openssh/sftp-server UsePAM yes EOF ;; OpenBSD|FreeBSD) - cat << EOF >> /etc/ssh/sshd_config + cat <> /etc/ssh/sshd_config Subsystem sftp /usr/libexec/sftp-server AuthorizedKeysFile .ssh/authorized_keys EOF @@ -123,7 +129,7 @@ case ${UNAME} in ;; esac -if [ -z "$(ps aux | awk '/\/usr\/s?bin\/sshd/')" ]; then +if [ -z "$(ps aux -w | awk '/\/usr\/s?bin\/sshd/')" ]; then echo "error: ssh service failed to restart" 1>&2 echo "please check for sshd config errors manually" 1>&2 exit 1