title: Disable ssh root login by modifying /etc/ssh/sshd_conf from within a script?
body: <p>During the process of setting up my Raspberries, I want to prevent root logins via ssh. As always, it's a &quot;scriptlet&quot; (called by a runner).</p>
  <p>My research told me that, even in times of systemd, <code>/etc/ssh/sshd_config</code> is the file to modify. So far, so good. In my humble understanding, what needs to be done is this: read the config file line by line, match for &quot;PermitRootLogin yes&quot; (whitespace match); if no match, write the line to another file, if yes, replace it with &quot;PermitRootLogin no&quot;, and write to the other file, and finally replace the original configuration file with the new file, and restart <code>sshd</code> via the systemd stuff.</p>
  <p>In Perl, I'd read the whole file, <code>replace()</code> the line, and write stuff back to another file. But as the young Buddhist said: &quot;There is no Perl!&quot;</p>
  <p>Bash(2) only, please.</p>