Posts

Removing Apache signature "Apache X.X.X running on Ubuntu"

On ubuntu, edit the file /etc/apache2/conf.d/security and modify the lines starting with ServerTokens and ServerSignature so that they look like this: ServerTokens Prod ServerSignature Off

Making your SSH server more secure with fail2ban

Today, when I was checking the logs on my server, I noticed that someone was trying to hack it by quessing usernames and passwords. The command cat /var/log/auth.log Returned something like this: Invalid user danica from (attacker ip) input_userauth_request: invalid user danica [preauth] pam_unix(sshd:auth): check pass; user unknown pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=(attacker ip) Failed password for invalid user danica from (attacker ip) port 20135 ssh2 Received disconnect from (attacker ip): 11: Bye Bye [preauth] reverse mapping checking getaddrinfo for (attacker host) [(attacker ip)] failed - POSSIBLE BREAK-IN ATTEMPT! Invalid user daniela from (attacker ip) input_userauth_request: invalid user daniela [preauth] pam_unix(sshd:auth): check pass; user unknown pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=(attacker ip) Failed password for invalid user daniela from (attacker ip) port 120...

grep IP addresses with regular expressions

If addresses.txt contains lines of addresses, this grep command will give you only the lines with a valid IP address and nothing else. cat addresses.txt | grep '^[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}$'`

Installing the no-ip.org client in Ubuntu

If you get "no such package" error when trying to install the no-ip client on Ubuntu, follow these instructions (more info at their help site ): cd /usr/local/src wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz tar xzf noip-duc-linux.tar.gz cd no-ip-2.1.9 make make install

Script for updating no-ip DDNS from behind the router

no-ip is my favourite dynamic DNS service, and I was saddened by the fact that my new Cisco EPC3825 cable modem didn't support it. I have a Linux server running, so my second option was to use that for updating the IP. All I needed was a script to do it for me, from inside the LAN of my home. Problem is, my server is in a LAN with an internal IP, while I need it to update no-ip.org with the IP address of my cable modem. It was made possible by 1) no-ip - maybe the best free dynamic DNS? 2) ifconfig.me - an AWESOME site for figuring out your IP in linux 3) some scripting skills 4) cron First, have an account at no-ip.org ready, so sign in and create an account if you haven't done it yet. Install curl and wget: apt-get install curl wget Install also the no-ip client (more info at their help site ): cd /usr/local/src wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz tar xzf noip-duc-linux.tar.gz cd no-ip-2.1.9 make make install Now...

Installing Labtec webcams for Windows 7

PROTIP: Just install the "Windows XP and Windows Vista" driver! At least it worked great for my Labtec Webcam 2200 and with Windows 7 32-bit. The drivers can be downloaded from: http://www.labtec.com/ Make sure you get the webcam model right!

Where does uTorrent keep its .torrent files?

NOTE: uTorrent cannot be trusted anymore. It is known to install Yandex, Ask Toolbar, a bitcoin miner and displayed ads among other fishy stuff. Don't use uTorrent! I recommend using qBittorrent instead, which is an open-source alternative. If you deleted uTorrent and want to remove all of its files, you might want to know where it stores them. On Windows 7, uTorrent stores .torrent files by default in: C:\Users\%USERNAME%\AppData\Roaming\uTorrent ...where %USERNAME% is your Win7 username, and assuming your Windows 7 installation is on C: drive. If you can't browse to this directory, write it on the address bar of Explorer. Another way is to show hidden files by going to Win7 control panel's "folder options" - then you can see the AppData folder.