Cyberpanel Fixperms script

So after some testing and slight mods was able to port the cPanel Fixperms to work for Cyberpanel accounts.

It now works for single accounts or for all Cyberpanel accounts.

Had to mod it some due to the uid differences between Centos and Ubuntu

Logic of how it loops through only the Cyberpanel users:

Centos first cyberpanel user account starts at uid 5002
getent passwd | awk -F: ‘5001<$3 && $3<6000 {print $1}’ |grep -v spamd

[root@centos ~]# id cyberpanel
uid=1000(cyberpanel) gid=1000(cyberpanel) groups=1000(cyberpanel),1001(docker)
[root@centos ~]# id docker
uid=1001(docker) gid=1001(docker) groups=1001(docker)
[root@centos ~]# id lscpd
uid=5001(lscpd) gid=5001(lscpd) groups=5001(lscpd),99(nobody),994(lsadm)
[root@centos ~]# id vmail
uid=5000(vmail) gid=5000(vmail) groups=5000(vmail)
[root@centos ~]#

Ubuntu first cyberpanel user account starts at uid 1002
getent passwd | awk -F: ‘1001<$3 && $3<2000 {print $1}’

root@ubuntu:~# id cyberpanel
uid=1000(cyberpanel) gid=1000(cyberpanel) groups=1000(cyberpanel),1001(docker)
root@ubuntu:~# id docker
uid=1001(docker) gid=1001(docker) groups=1001(docker)
root@ubuntu:~# id lscpd
uid=5001(lscpd) gid=5001(lscpd) groups=5001(lscpd),65534(nogroup),999(lsadm)
root@ubuntu:~# id vmail
uid=5000(vmail) gid=5000(vmail) groups=5000(vmail)
root@ubuntu:~#

If you notice any issues let me know and I’ll see about adding any modifications if a different system user like spamd or something is getting included by accident.

Enjoy