X7ROOT File Manager
Current Path:
/etc/yum/universal-hooks/multi_pkgs/posttrans/ea-__WILDCARD__
etc
/
yum
/
universal-hooks
/
multi_pkgs
/
posttrans
/
ea-__WILDCARD__
/
π
..
π
001-ensure-nobody
(2.17 KB)
π
009-phpconf.pl
(19.12 KB)
π
010-purge_cache.pl
(2.82 KB)
π
010-suphpconf.pl
(3.89 KB)
π
011-modsec_cpanel_conf_init
(93 B)
π
020-rebuild-httpdconf
(90 B)
π
030-update-apachectl
(90 B)
π
060-setup_apache_symlinks.pl
(5.16 KB)
π
070-cloudlinux-cagefs.pl
(2.24 KB)
π
300-fixmailman.pl
(1.76 KB)
π
400-patch_mod_security2.pl
(3.78 KB)
π
500-restartsrv_httpd
(2.43 KB)
π
520-enablefileprotect
(150 B)
Editing: 001-ensure-nobody
#!/usr/bin/perl use strict; use warnings; system("touch /etc/systemd/dont-synthesize-nobody") if -d "/etc/systemd"; my $uid = getpwnam("nobody"); my $gid = getgrnam("nobody"); my @ids = ( 65534, 99 ); my $user_needs_informed = 0; if ( !defined $gid ) { $user_needs_informed = 1; my $addgroup = -x '/usr/sbin/groupadd' ? "groupadd" : "addgroup"; for my $id (@ids) { system("$addgroup --system --gid $id nobody"); $gid = getgrnam("nobody"); last if defined $gid; } if ( !defined $gid ) { system("$addgroup --system nobody"); } $gid = getgrnam("nobody"); die "Could not ensure `nobody` group\n" if !defined $gid; } if ( !defined $uid ) { $user_needs_informed = 1; my $flags = -x '/usr/sbin/groupadd' ? "" : "--disabled-password --disabled-login"; for my $id (@ids) { system("adduser --system --uid $id --gid $gid --home / --no-create-home --shell /sbin/nologin $flags nobody"); $uid = getpwnam("nobody"); last if defined $uid; } if ( !defined $uid ) { system("adduser --system --gid $gid --home / --no-create-home --shell /sbin/nologin $flags nobody"); } $uid = getpwnam("nobody"); die "Could not ensure `nobody` user\n" if !defined $uid; } # if already done, its a noop. adduserβs --gid does not make this happen system("usermod -g $gid nobody"); my $home = ( getpwnam("nobody") )[7]; if ( !-d $home ) { # We do not want to create it for them in case there are other implications in /nonexistent existing. # We canβt `usermod --home / nobody` for them because weβd have to hard stop all nobody processes first. my $sep = "#" x 42; print <<"END_HOMEDIR"; $sep [WARN] Detected non-existent home directory for `nobody`. This situation can result in some harmless STDERR going to your web serverβs error log as errors. If you experience this your options are: 1. Ignore the log entries 2. Create the directory β$homeβ if it is safe to do so. 3. Change the `nobody` userβs home directory to one that exists. e.g. `usermod --home / nobody` $sep END_HOMEDIR } print "[INFO] `nobody` user created with UID $uid and GID $gid\n" if $user_needs_informed;
Upload File
Create Folder