new versions
This commit is contained in:
parent
80e4219fe1
commit
3a4a2177da
2 changed files with 16 additions and 10 deletions
|
|
@ -11,7 +11,7 @@ GITHUB="https://github.com/golang/go/archive/"
|
||||||
V14="go1.4.3"
|
V14="go1.4.3"
|
||||||
TGZ14="${V14}.tar.gz"
|
TGZ14="${V14}.tar.gz"
|
||||||
|
|
||||||
Vnew="go1.6.2"
|
Vnew="go1.7.3"
|
||||||
TGZnew="${Vnew}.tar.gz"
|
TGZnew="${Vnew}.tar.gz"
|
||||||
|
|
||||||
INSTALL="/usr/local"
|
INSTALL="/usr/local"
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,16 @@ if [ "${answer}" != "y" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /etc/ssh/moduli ]; then
|
ssh_moduli="/etc/ssh/moduli"
|
||||||
|
moduli="/etc/moduli"
|
||||||
|
if [ -f ${ssh_moduli} ]; then
|
||||||
echo "filtering safe primes"
|
echo "filtering safe primes"
|
||||||
awk '$5 > 2000' /etc/ssh/moduli > /tmp/moduli
|
awk '$5 > 2000' ${ssh_moduli} > /tmp/moduli
|
||||||
mv /tmp/moduli /etc/ssh/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
|
else
|
||||||
echo "generating safe primes"
|
echo "generating safe primes"
|
||||||
echo "warning: this can take a long time (2h+)"
|
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
|
mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat << EOF > /etc/ssh/sshd_config
|
cat <<EOF> /etc/ssh/sshd_config
|
||||||
Port 22
|
Port 22
|
||||||
Protocol 2
|
Protocol 2
|
||||||
HostKey /etc/ssh/ssh_host_ed25519_key
|
HostKey /etc/ssh/ssh_host_ed25519_key
|
||||||
HostKey /etc/ssh/ssh_host_rsa_key
|
HostKey /etc/ssh/ssh_host_rsa_key
|
||||||
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
|
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
|
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-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
|
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
|
UsePrivilegeSeparation sandbox
|
||||||
PermitRootLogin no
|
PermitRootLogin no
|
||||||
RSAAuthentication no
|
RSAAuthentication no
|
||||||
|
|
@ -71,14 +77,14 @@ EOF
|
||||||
|
|
||||||
case ${UNAME} in
|
case ${UNAME} in
|
||||||
Linux)
|
Linux)
|
||||||
cat << EOF >> /etc/ssh/sshd_config
|
cat <<EOF>> /etc/ssh/sshd_config
|
||||||
AuthorizedKeysFile %h/.ssh/authorized_keys
|
AuthorizedKeysFile %h/.ssh/authorized_keys
|
||||||
Subsystem sftp /usr/lib/openssh/sftp-server
|
Subsystem sftp /usr/lib/openssh/sftp-server
|
||||||
UsePAM yes
|
UsePAM yes
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
OpenBSD|FreeBSD)
|
OpenBSD|FreeBSD)
|
||||||
cat << EOF >> /etc/ssh/sshd_config
|
cat <<EOF>> /etc/ssh/sshd_config
|
||||||
Subsystem sftp /usr/libexec/sftp-server
|
Subsystem sftp /usr/libexec/sftp-server
|
||||||
AuthorizedKeysFile .ssh/authorized_keys
|
AuthorizedKeysFile .ssh/authorized_keys
|
||||||
EOF
|
EOF
|
||||||
|
|
@ -123,7 +129,7 @@ case ${UNAME} in
|
||||||
;;
|
;;
|
||||||
esac
|
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 "error: ssh service failed to restart" 1>&2
|
||||||
echo "please check for sshd config errors manually" 1>&2
|
echo "please check for sshd config errors manually" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue