Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jul 2021 23:34:22 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d2d322b0123e - stable/13 - Fix the pattern for changing PermitRootLogin
Message-ID:  <202107302334.16UNYM7c084346@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by imp:

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

commit d2d322b0123e7654529c800664861b836de0daf2
Author:     Jose Luis Duran <jlduran@gmail.com>
AuthorDate: 2021-07-16 17:11:47 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-07-30 23:02:13 +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
    
    (cherry picked from commit 73358cd2cfccf9aafde069ffcb8185a0f3420ffd)
---
 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
 )
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107302334.16UNYM7c084346>