setup.ssh: keep the newline when commenting out AcceptEnv

The $ in /(^\s*AcceptEnv.*$)/ matches before the newline, so $1 did not
contain it and the following line was appended to the comment - which
commented out the Subsystem sftp line on a stock Debian sshd_config.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 10:55:10 +02:00
co-authored by Claude Opus 5
parent 78599ffff5
commit 96c5c2e65d
+1 -1
View File
@@ -9,7 +9,7 @@ while(<IN>) {
if (/^\s*\#*\s*PermitRootLogin/) { if (/^\s*\#*\s*PermitRootLogin/) {
$out.="PermitRootLogin yes\n" ; $out.="PermitRootLogin yes\n" ;
} elsif (/(^\s*AcceptEnv.*$)/) { } elsif (/(^\s*AcceptEnv.*$)/) {
$out.="#$1"; $out.="#$1\n";
} else { } else {
$out.=$_; $out.=$_;
} }