Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple sed patcher
sed -i -f - /etc/ssh/sshd_config <<EOF
1{
i # this content comes from the %{name}-%{version}-%{release} package
i AddressFamily inet
i Protocol 2
i LogLevel VERBOSE
i HostbasedAuthentication yes
i IgnoreUserKnownHosts yes
i IgnoreRhosts yes
i Banner /etc/ssh/banner.txt
i # end of content from the %{name}-%{version}-%{release} package
}
/Protocol/d
/LogLevel/d
/HostbasedAuthentication/d
/IgnoreUserKnownHosts/d
/IgnoreRhosts/d
/AddressFamily/d
/Banner/d
/%{name}.*package/d
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.