From b778d6eaf3ac4ad7f99cd7058bd65caa9c51cfab Mon Sep 17 00:00:00 2001 From: gashapwn Date: Sat, 28 Nov 2020 20:31:11 +0000 Subject: [PATCH] adjusted provison.pl to exlcude nobody user from becoming admin --- perl-script/provision.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-script/provision.pl b/perl-script/provision.pl index 44079a9..d2017c5 100644 --- a/perl-script/provision.pl +++ b/perl-script/provision.pl @@ -10,7 +10,7 @@ my $admin_un; # Check /etc/passwd for the username created during # installation -if( ($admin_un) = `tail /etc/passwd` =~ /([^:]+):[^:]+:[0-9]{4,}/){ +if( ($admin_un) = `tail /etc/passwd | grep -v "nobody:"` =~ /([^:]+):[^:]+:[0-9]{4,}/){ printf("admin user will be set to %s\n", $admin_un); }else{ die "create a non-root user & set user passsword before running this script."