Monday, August 10, 2009

Avoid ssh attacks

If you ever look at you security logs and found something like

sshd[18561]: Failed password for invalid user nagios from 69.197.163.178 port 47771 ssh2


This a brute force attack to you server, yes there are some people with scripts that can be found on the net, that just try to login to you sever using a dictionary of common used users and password, so how do we avoid this, you can install denyhosts script you can download it from http://denyhosts.sourceforge.net/ or if using Fedora just do yum install denyhosts

After installation remember to set it up to start and set it to start on the next boot.

Fedora

service denyhosts start

and

chkconfig denyhosts on

How it works, it read the secure logs of your sever and watch for the host attacking your system, and the user, then it update the info on the /etc/hosts.deny file on your system so the services will not respond to this host attack again.

How ever there are more options to secure your sever using this script, for those please read


This is cool right. Enjoy.

Giving a little .. to make something big.

Been around GNU/Linux for several years, learning, showing the advantage of Free Software, and more important enjoin my self with all this free tools, I was wandering how can we contribute to this free software community, some projects has donations links, but if you want to help out and you don't have the computer skills or the money to give away, what you could do?

Well, http://fedoraproject.org is right for you, no need of advance skills, just join, and there are many projects and ways to contribute, of course if your advance coder you can join those groups too, but more important is that is open to any one. You can join to be at events, participate on improvements, help others on the use of Free Software. Every one is welcome, programmers , sysadmins, graphic designers, people persons, translators and some other projects.

So don't miss the opportunity to give something to the community that give you lot of things for free.

Tuesday, July 7, 2009

Recovering files from a wipe out disk.

Well as you know you better be prepare for the worst not only with backups but also with tools to recover files, with luck we ride Linux and all those tools are free, here is the ones I just recently use:


TestDisk



You can download from here http://www.cgsecurity.org/wiki/TestDisk_Download

and

Ddrescue

You can download it from here http://ftp.gnu.org/gnu/ddrescue/

A great tutorial on how to use them is found here.

http://www.linux.com/news/enterprise/storage/8257-how-to-recover-lost-files-after-you-accidentally-wipe-your-hard-drive


Hope it help you out, it did work for me.

Thursday, July 2, 2009

Welcome Fedora 11.

Well this month was the official release of Fedora 11, so lets download the Live CD after download just reboot my notebook and after a while there it was Fedora 11 working no complains no rush no problems, but since it was the first test let wait a bit more.


A week later there was a request to setup Linux on a Asus Eee PC 4G, so why not use Fedora 11 on it, well it did work with no problem there, of cource this was Gnome distribution CD and this is small machine with a Celeron 512 MB of RAM and of course 4G as hard drive, so we kick out Gnome and use Xfce, just use


yum install xfce


Later we remove gnome and install some gnome applet that we needed to work on xfce one of them Network Manager applet. By doing so we won almost 800 Mbytes of free space, of course we require Open office and it eat almos 300 Mbytes, but it was working.


So installing and configuring from the Live CD work like a charm.


Now let try to upgrade my Fedora 10 notebook to Fedora 10.

To do so we run the yum upgrade and it came to this




It downloaded the release info and installer images and after a while this is a while, you can interrupt the process because it will continue later and it will restart at the point you close it. So long waiting it ask me to reboot to continue the upgrade process did some and the upgrade was completed after a couple of hours, it really works. One thing however is it take to much time on the overall process so my recommendation will be to upgrade from a distribution DVD it will save you time.


After all upgrade my screen came nice but as always some small details, the first thing to notice was that the compiz fuzion did not work any more Ati drive was not working as before, after a lot test following procedures from the Fedora forums but nothing works, why because there is no a release form my ATI Radeon Movility 9100 IGP module on the new kernel yet. So will have to wait to be able to work with desktop effects for it.


The other thing that did not work was my ruby script language, natural i have to compile it again and works.

Eclipse, Aptana has to be installed noting new there.


The omnibook driver has to be compile again so it was compile and it works no problem there and now my CPU work cooler than ever, guest a better kernel management.


The same machine and some how it feel a little faster now, maybe me, so Thanks to the people working on Fedora 11 nice going, still will wait and see how it works with compiz.


Congrats to the Fedora Team.

Saturday, June 27, 2009

CPU Speed and performance on a Notebook with Linux.

After installed Fedora on my notebook, CPU Frequency was always on 50% of the nominated CPU frequency in my case 1.87 GHz but my CPU can go up to 3.2 GHz, that changed on demand as controlled by the kernel, and it did work fine for me how ever sometime launching programs like Eclipse it took to long to load even when the CPU speed when up to 100%, and notebooks are set this way to save energy when using the battery, but what if we want to have the CPU running at 100% when corrected to the electrical outlet and not using battery can we set it up, well this is Linux so there must be a way of doing this, and of course it can be done here goes how.

First we need to install this packages:

cpufrequtils
cpuspeed

also recomend to install

lm_sensors

To install those packages you can simple do:

yum install cpufrequtils cpuspeed lm_sensors

after installing those packages you will have some information about your CPU by typing cpufreq-info


Report errors and bugs to cpufreq@vger.kernel.org, please.

analyzing CPU 0:

driver: acpi-cpufreq

CPUs which need to switch frequency at the same time: 0

hardware limits: 1.87 GHz - 3.20 GHz

available frequency steps: 3.20 GHz, 2.93 GHz, 2.67 GHz, 2.40 GHz, 2.13 GHz, 1.87 GHz

available cpufreq governors: userspace, performance
,ondemand
current policy: frequency should be within 1.87 GHz and 3.20 GHz.

The governor "ondemand" may decide which speed to use

within this range.

current CPU frequency is 1.87 GHz.



This will show you what driver control your CPU frequency and the policy is set and the frequency it is working at the moment you run the command.

cpufreq-set -c 0 -f 3.20 GHz -g performance

where C is the CPU number
f is the frequency you want
g is the governor you are setting
Let check the change

cpufreq-info

Report errors and bugs to cpufreq@vger.kernel.org, please.

analyzing CPU 0:

driver: acpi-cpufreq

CPUs which need to switch frequency at the same time: 0

hardware limits: 1.87 GHz - 3.20 GHz

available frequency steps: 3.20 GHz, 2.93 GHz, 2.67 GHz, 2.40 GHz, 2.13 GHz, 1.87 GHz

available cpufreq governors: userspace, performance

current policy: frequency should be within 1.87 GHz and 3.20 GHz.

The governor "performance" may decide which speed to use

within this range.

current CPU frequency is 3.20 GHz.



Remember you need to do this set for each CPU if you have more that one CPU.

Of course this will set your CPU frequency for this session but what if you want to set your CPU to a 100% frequency every time you boot your notebook, then you need to use the cpuspeed service.

First we need to edit the cpuspeed configuration file that is at /etc/sysconfig/ , you can edit this file with vi or your favorite editor, you will need to change this line


GOVERNOR=

to

GOVERNOR=performance

this will set you CPU to full speed all the time, to change the way it behave when it is working with the battery look at the en of the file and uncommend the line


OPTS="$OPTS -a /proc/acpi/ac_adapter/*/state "

you can also uncomment this

# uncomment and modify this to check the state of the AC adapter

OPTS="$OPTS -a /proc/acpi/ac_adapter/*/state "



you may need to change this line to the location of your temperature file normally at acpi but it may vary depending on you system
# uncomment and modify this to check the system temperature

OPTS="$OPTS -t /proc/acpi/thermal_zone/temperature 65"


if you restart you system you will see your CPU frequency changes. Also if you added the CPU performance applet on you desktop you can see your changes.

You may need to read more on the way cpuspeed there are more settings there. Please use this information with care your and at your risk.

Tuesday, June 23, 2009

CPU temperature indicator on your desktop

If you want to have your CPU temperature on your desktop without having to load some system monitoring tool like Gkrellm or other programs you can use the Gnome sensor-applet from http://sensors-applet.sourceforge.net/ you can download it and install.

To download you can use this depending on your distribution:

Debian
apt-get install sensors-applet

Fedora
yum install gnome-applet-sensors


The advantage of using the yum or apt-get format is that it will install all dependencies, you can also download the source and compile your self.

After you install it you can add the applet to your panel and have it show on your desktop. They will look like this:











It not only will give you the ability to see the temperature values but also set alarms and trigger some programs or scripts.

On of the key features for me it was that it support reading the temperature of my old Toshiba A75 notebook, where the sensor library does not work. It does that by supporting the old omnibook standard, but as always to add that support to my Fedora 10 have to figured out what version of omnibook will work and since it is and old standard most of the omnibook libraries are old and supporting old kernels, so here is what work for me:

There are two projects on SourceForge.net for this http://sourceforge.net/projects/omke/ and http://sourceforge.net/projects/omnibook/ the omke project has a kernel module that did not compile with my kernel (2.6.27.24-170.2.68.fc10.i686) but the omnibook project did work only if downloaded sources from the trunk version, the release version did not work. So here are steps to download the SVN version:
You will need svn if you don't have it use yum install svn.

svn co https://omnibook.svn.sourceforge.net/svnroot/omnibook omnibook

after that you will need to execute as root or a sudo user

./configure

Then

make

make install

Now your sensor-applet will be able to read your cpu temp

You can also install this two scripts komnibook and omke scripts they will be used to generate a configuration and manage you omnibook notebook. They are here http://sourceforge.net/project/showfiles.php?group_id=48623

Good look and enjoy!

Monday, June 15, 2009

Setting your Hotmail , live email accounts on Evolution (Linux).

After a change on protocols Hotmail and Live email service can receive and send email using Evolution. This is not something new some smart people manage a way to set them up on Evolution before, must of them using some smtp servers and other programs like gotmail, hotsmtp, hotway. But now it got very simpler:

Create Hotmail/Live account on evolution:



add your information then go to the next tab Receiving Email and set it to pop type account and the server as pop3.live.com you need to also set the ecryption type to SSL.



That will allow you to get you email from your hotmail account to your Evolution Inbox, now to send email, on the Send Email tab set to smtp the smtp server is smtp.live.com you need to select the authentication method to TLS and you server require authentication also set your account user name.


Now your are set you can send and receive emails using you Hotmail account from evolution. Enjoy.