If you tested pihole, you perhaps look for a smaller Command Line version? Install dnsmasq by: sudo apt-get install dnsmasq Here DNS Rule Injector Script (copy & paste): blocker.sh # www.linuxonlinehelp.eu 2019 # DNS Blocker for Small Linux with dnsmasq # #!/bin/bash # goto tmp (tmpfs) cd /tmp/ # get URL-Blocklists wget -O blocklist.txt https://v.firebog.net/hosts/Kowabit.txt # get Templates #SET Variables txt='blocklist.txt' IP='0.0.0.0' # set to 0.0.0.0 or to a Webserver with "white Page" showing Text "URL-blocked!! #merge URLs and redirect to wanted IP – Rule creation n=1; while read line; do echo 'address=/'$line'/$IP '>> 02-blocked1.conf ; n=$((n+1)); done < $txt […]
Tag: console
Linux Console: SSH Echo Last User LOGIN Info
If you use SSH Logins to your Systems, you perhaps want to know, who logged in last days and from which IP Address. Screenshot SSH Login Echo LAST Info: Howto: Open the .profile File at your Home with a Editor and enter: clear last -n 4 This will echo after login the last 4 Logins including the used IP’s To prevent Hackers to purge the lines set the .profile File “readonly” sudo chmod 444 .profile sudo chown root:root .profile
WordPress: Change User Password manual on mysql prompt
If you don’t want to use Passwords generated by wordpress itself, you can do it manual on a MYSQL Console howto: Login to your Webserver with the Database via encrypted SSH!! Login to the MYSQL Server Conssole with $ mysql -u username -p Enter Password, and change database with mysql>use database-name-of-blog Now Set Password for the User mysql>UPDATE wp_users SET user_pass = MD5('NEWPASSWORD-16-DIGITS') WHERE user_login = "THEUSERNAME"; System shows Echo: mysql> ok.. Changed 1 Row.. Quit mysql> exit Logout of SSH
Password: Simple script generator on a linux console
If you need a password creator for your daily needs you can do this with a default tool called openssl / libressl and a small bash script: Howto: open a console open as user a editor like nano or vi with $nano pwcreate.sh insert this: #!/bin/sh /bin/bash -c "for i in {1..20}; do openssl rand -base64 32; done" exit 0 exit and save the script set it to runable with $chmod 755 pwcreate.sh test it.. with ./pwcreate.sh should echo like this: 6gUUuothdHwwaWHjA/UhyCiV3FWpPC1lBQTIY3IiQn8= ozqloLyWXQyBJlcVXPVLY2PBpRV04uVkWrP6c1epxCs= gjLE6MWeK+c6EBx1wV/uUxubtrLoeUpXb4GCIEQK3b8= X4RoYhASR6i4BfwDYoB2+/gNWY1P35MM6jJYaOEpV0M= dXoLBGrRC+oei6cm6N1bD8k/ntZi5grtKLEH6SytTXQ= 2DZ1yAi96xvGlHQLQoexUhPc2w1iIqoeVW8zHaMmsvU= Vmq4r5ZXC2EKu5Ze7SLBbKavpkLQC0RRrXEGlDmxfpY= FSXmp+cVKPvpq/JhyhuGHJ2ue3L6hLEcX6XfkUCrYqg= GvbWjPYvoOWJPOMOG6oihGFQv9wNgwZO2Go/ogJkmBM= z6P+VHsGBPKTpR6yzThKjyGVVwa/WWtuv/G/aO27bEM= qBozaA2PMMy+zhVrvUNVSbP2mg9KshsXYfTzuTvmlkI= ARYyGx2dE1yfPJydBlvaNXpKmRbZI7CHbcCPDHgTcNo= 7PrqMZqFJ7gqeGzWjdqFCdIHvnl3vgoYAxiL4wN2Jcw= q6Wwi1rG0j0WqXuUhdIpZ2C7BergeqSExDv87a/DIsw= d7R6nCuYo6lo+gFiwroaAeG5RxPxWrPDf8oJxv+toHU= 7EQZysp2leEqP6eDp8M6+DeT71gpyqYEiSzMvMLjMys= B7J3JdrDxFCW3rV09Ut+wLukVgSUk41SroBQTzrgirY= yXrgYLD2YK2DN+aZCF4N6WXO/IL5RC6JM2mxW3xAnbc= Wr/QF46wo5Dtobl5maojZc2jrF4bvO1sNWed8OpTsTc= […]
Clean Linux Console tty1 after boot or logout
Problem: At a server everybody can see messages at tty1 Solution: Open a console as root or with “sudo” and insert. # sudo echo -e '\e[H\e[2JUbuntu 8.04 \\n \\l\n' | sudo tee /etc/issue > /dev/null