Make no mistake about it, I’m a Deportivo supporter. It can rain, snow, rain again, be first in the Liga, be last, sick or healthy and I’ll keep being a Deportivo fan. Last couple of matches(eleven to be exact) have me really worried. How is it possible to fall from the fourth position to in the first part of the Liga to be the worst team in the second part? It’s true that we had a bunch of injured players and Lafita and Verdú are not with us this season, but there must be something else. I just hope we win a match before the end of the season and that this doesn’t happens next on the next championship. Lets see what they do tomorrow against Mallorca in Riazor.
Coffee
I have been living in NYC for some time now. I must admit it was hard for me to get used to coffee in the City. I have tried Starbucks, Dunkin Donuts and some others which I don’t recall. I must admit I have found really good coffe at Pret. It’s all organic , tasteful coffee beans. Size of a cup of coffee is not expensive either, less than two dollars for a large. I am not able to understand how people is so obsessed with Starbucks, I really don’t think coffee quality is as good as Pret.
Blocking SSH attacks with IPtables
If you have a website running you might get brute force attacks on the ssh port. Below is an excerpt from the logs in /var/log/auth.log
Jan 28 21:32:16 server sshd[10855]: Failed password for illegal user root from 213.191.74.219 port 51033 ssh2
Jan 28 21:32:16 server sshd[10857]: Illegal user root from 213.191.74.219
Jan 28 21:32:16 server sshd[10857]: Failed password for illegal user root from 213.191.74.219 port 53722 ssh2
Jan 28 21:32:16 server sshd[10859]: Illegal user root from 213.191.74.219
Jan 28 21:32:16 server sshd[10859]: Failed password for illegal user root from 213.191.74.219 port 54393 ssh2
Jan 28 21:32:16 server sshd[10861]: Illegal user root from 213.191.74.219
Jan 28 21:32:16 server sshd[10861]: Failed password for illegal user root from 213.191.74.219 port 55099 ssh2
Blocking this attacks is really easy with IPtables. Just type the following from the CLI.
sudo iptables -A INPUT -i eth0 -p tcp –dport 22 -m state –state NEW -m recent –set –name SSH
sudo iptables -A INPUT -i eth0 -p tcp –dport 22 -m state –state NEW -m recent –update –seconds 60 –hitcount 3 –rttl –name SSH -j DROP
The above command will block ssh attacks on the SSH port on your server. Enjoy.
Setting passwordless ssh trust
I’m going to explain how to set ssh trust between two hosts. This would allow us to connect to the server without having to type the password.
1) First generate the public and private keys on the machine from where you want to log in to other machines. This can be accomplished in two ways depending on the ssh version running on the server you want to log in. I recommend using ssh version 2. Ssh version 1 has security flaws.
Type from the command line:
# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_dsa.
Your public key has been saved in /home/user/.ssh/id_dsa.pub.
The key fingerprint is:
86:40:27:c5:29:ce:64:35:1f:a9:b9:9c:f0:97:a5:4d user@server
The key’s randomart image is:
+–[ DSA 1024]—-+
| o+=… |
| .+ooo.. |
| =.. o. |
| +.o. E |
| +.oS* |
| =.+ . |
| . |
| |
| |
+—————–+
#
This will generate a public and a private key in the ~/.ssh directory. Don’t type anything when asked for the passphrase. Now we need to copy the public key to the server we want to log in passwordless.
2) Type the following.
# scp ~/.ssh/id_dsa.pub user@remote_server:/tmp
3) Log into the remote server and copy the public key to the authorized_keys file in the ~/.ssh directory.
remote_server# cat /tmp/id_dsa.pub >> ~/.ssh/authorized_keys
That’s it. You are done. Enjoy.
Hello NYC
Testing from my Google phone.