summaryrefslogtreecommitdiff
path: root/config-mgmt-ssh.PKGBUILD
blob: 2c2831a61deb79fcd32a1367a6a495d85e8394de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
. ${BUILDFILE%/*}/common.sh
pkgver=20170204.5

package() {
preamble

depends=(openssh)

add-file -m755 usr/share/holo/files/10-"$pkgname"/etc/ssh/sshd_config.holoscript <<EOF
#!/bin/sh
{
	sed '
		/^#Port/{
			aPort 22
			aPort 1863
		}
		/^#PermitRootLogin/{
			aPermitRootLogin no
		}
	'
	echo
	echo '## Crypto improvements'
	echo '## https://stribika.github.io/2015/01/04/secure-secure-shell.html'
	echo 'KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256'
	echo 'Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr'
	echo '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'
} | awk '\$0==""||!x[\$0]++'
EOF

add-unit etc/systemd/system/multi-user.target.wants/sshd.service

postamble
}