OS Hardening
Just allow strong algorithms: echo “MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256” >> /etc/ssh/sshd_config echo “KexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org” >> /etc/ssh/sshd_config echo “disable_vrfy_command=yes” >> /etc/postfix/main.cf Change SSH Port Do not use default port 22
Bulk rename files on Windows
In terminal, easy to change all files’s name by this script In example:
Count connections to the Server
Find nginx pid: Results: pool: mean nginx run php-fpm master: not worker, just is a parent cache manager: Just for cache color=auto: The ps -ef | grep nginx worker process: This is result. 57234 is parent pid, this pid is 57235 So, if we have many worker process pids from 1833681 to 1833692. We can…
Write Error Logs only in mongodb.log
Write Cron Job as below Change example by your path
Install VPN Client on Linux
My Example for RHEL/Centos/Linux… Important: Just some SNX Build version work in CLI mode! Install SNX build 800007075: Or install SNX build 800010003: Connect to VPN Checkpoint:
Create new Linux User with ChrootDirectory
This is quick trick for chroot user in Linux Or make a bash-script for 1 hit (save below code in create-user.sh file then run):
How to alert when disk usage is greater than the allowable threshold easily?
Alert when disk usage is greater than the allowable How to alert when disk usage is greater than the allowable threshold easily?You can set a cron job to check disk usage then send to you alert-API when it is greater than the allowable threshold. Here is an example, hourly periodic check. If the system has…
Completely remove user accounts on linux for security
Completely remove user accounts on linux for security:Show all User account: Kill all programs running by this user: Delete the user, all the user’s files and folders will also be deleted:
Install and use Docker on Linux/ Centos/ Rocky Linux
Basic: Build from OS and your apps
[Installation] System monitoring with Grafana + Prometheus + Node Export on Linux
This guide use RHEL/Centos/RockyLinux. Other OS are same. You should have 2 SERVERs: Monitoring server: Install Grafana Monitored server: Install Prometheus PROMETHEUS INSTALL (On monitored server) Create user for this service: // Swap to prometheus user: Create directories: Download Prometheus: Create a config file: Create a service file, this is an examle use port 9090…