mirror of
https://codeberg.org/privacy1st/arch
synced 2024-12-23 01:16:04 +01:00
24 lines
723 B
Plaintext
24 lines
723 B
Plaintext
|
#!/bin/sh
|
||
|
# stdin: default config
|
||
|
# stdout: modified config
|
||
|
|
||
|
# save stdin (content of /etc/ssh/sshd_config) in variable
|
||
|
stdin=$(cat)
|
||
|
|
||
|
# asertions
|
||
|
echo "$stdin" | grep '^UsePAM yes$'
|
||
|
#
|
||
|
echo "$stdin" | grep '^#PermitRootLogin\s.*$'
|
||
|
echo "$stdin" | grep '^#PubkeyAuthentication\s.*$'
|
||
|
echo "$stdin" | grep '^#PasswordAuthentication\s.*$'
|
||
|
echo "$stdin" | grep '^#PermitEmptyPasswords\s.*$'
|
||
|
echo "$stdin" | grep '^#X11Forwarding\s.*$'
|
||
|
|
||
|
sed '
|
||
|
s|^#PermitRootLogin\s.*$|PermitRootLogin no|;
|
||
|
s|^#PubkeyAuthentication\s.*$|PubkeyAuthentication yes|;
|
||
|
s|^#PasswordAuthentication\s.*$|PasswordAuthentication no|;
|
||
|
s|^#PermitEmptyPasswords\s.*$|PermitEmptyPasswords no|;
|
||
|
s|^#X11Forwarding\s.*$|X11Forwarding no|
|
||
|
' <<< "$stdin"
|