git: 73358cd2cfcc - main - Fix the pattern for changing PermitRootLogin

Warner Losh imp at FreeBSD.org
Sat Jul 24 18:19:47 UTC 2021


The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=73358cd2cfccf9aafde069ffcb8185a0f3420ffd

commit 73358cd2cfccf9aafde069ffcb8185a0f3420ffd
Author:     Jose Luis Duran <jlduran at gmail.com>
AuthorDate: 2021-07-16 17:11:47 +0000
Commit:     Warner Losh <imp at FreeBSD.org>
CommitDate: 2021-07-24 18:19:19 +0000

    Fix the pattern for changing PermitRootLogin
    
    The previous pattern had the (harmless) side-effect of duplicating the
    entry in the config file.
    
    No functional change intended.
    
    Reviewed by:    imp
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/510
---
 tools/tools/nanobsd/defaults.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 77c0e216ec80..45d9fe44c650 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -728,7 +728,7 @@ cust_comconsole ( ) (
 # Allow root login via ssh
 
 cust_allow_ssh_root ( ) (
-	sed -i "" -e '/PermitRootLogin/s/.*/PermitRootLogin yes/' \
+	sed -i "" -E 's/^#?PermitRootLogin.*/PermitRootLogin yes/' \
 	    ${NANO_WORLDDIR}/etc/ssh/sshd_config
 )
 


More information about the dev-commits-src-all mailing list