Archive

Archive for January, 2010

stropts.h: No such file or directory – How to Fix

January 30th, 2010 No comments

It is a known issue that modern Linux systems are missing stropts.h file. You will probably have some problems when trying to compile software like pppd, pptp, gftp, etc from sources. Seems to be a strange thing, as you won’t get any errors in previous versions of Linux. Most recent versions of don’t contain this file, that’s why we need to know what to do if software compilation fails because of missing stropts.h.

Let’s determine when we need to have this file on our machine.When we’re compiling any “old” package from sources, we may receive the following error:

What could be the reason and why isn’t this file included into our Linux distribution?This error means that your system doesn’t support STREAMS.

Linux doesn’t support STREAMS (many years ago it was available as a third party module, but it hasn’t worked for years). is part of a POSIX XSR option, which is not supported in modern Linux distributions. Do we really need it in Linux?

This means that software you’re trying to compile, will not use the functions listed under stropts.h as they’re not supported by the operating system. So we will do a simple trick that will let you to compile your software without these functions.

Since the stropts.h is required for a successful compilation, the most simple way to solve the issue is to create a blank file named stropts.h under /usr/include. You may want to put any comments there, this way you won’t forget what was the reason to create this file.

This simple trick will help you to compile pptp (1.7.2),  pppd (2.4.5), and I think that the list will be much bigger. That was just my experience, but the sense remains the same: you need this file for a successful compilation. Just create it and have fun! :)

How to Disable Dynamic DNS Update in bind

January 30th, 2010 No comments

First of all, let’s figure out what Dynamic DNS update is and why it is used in most recent versions of bind.

Dynamic update represents the idea of exchanging data between two computers with known names both visiting an unknown network where we don’t know, care or trust the underlying address.

It is now possible to point your neighbor at the IETF conference to a web page on your laptop by pointing at the URL on your business card using this technology.

When this feature is enabled, your computer has a potential vulnerability, if your bind configuration is secured using TSIG keys or SIG(0). I will create a post on this subject a bit later, but now I’m going to tell you how to disable Dynamic Updates, if you are unsure whether they are secure.

We need to edit named.conf using any editor available. For each domain zone, that should be secured, we need to add a string. Let me show you how to do it. Here is my zone config before:

zone “lampdocs.com” { type master; file “/var/named/lampdocs.com.db”; };

We’re adding a line to disable dynamic DNS updates:

zone “lampdocs.com” { type master; file “/var/named/lampdocs.com.db”;
allow-update { none; };
};

That’s all. Now Dynamic DNS updates are disabled for your domain. Don’t forget to restart bind to activate your input.

Public DNS From Google: Improve Your Security

January 29th, 2010 No comments

Google has lately launched its new service named . What does it mean and how do you use them? Here is a brief excerpt from Google:

Google Public DNS is a free, global Domain Name System (DNS) resolution service, that you can use as an alternative to your current DNS provider.

To try it out you need to configure your network settings to use the IP addresses 8.8.8.8 and 8.8.4.4 as your DNS servers.

If you decide to try Google Public DNS, your client programs will perform all DNS lookups using Google Public DNS.

How to do this in Linux? If you are a console fun, you should edit the /etc/resolv.conf file by entering these values:

nameserver 8.8.8.8
nameserver 8.8.4.4

Google promises to speed up your browsing experience, and to improve your security. Not sure about the speed, but security is the thing you need to think about. I have recently tried Comodo DNS and was very unsatisfied with its speed. Google should release something that should be faster than my ISP’s DNS, for me to use their service :-) . In fact, users from small countries will see the difference, like I did.

Google Groups have relatively small amount of user warnings, and this service seems to be stable enough. You’re welcome to give it a try to decide.

Setting Up NTP Time Synchronization in CentOS

January 29th, 2010 2 comments

If you need to have valid date and time on your server, you need to synchronize it with a time server as well. In order to do this in Linux (especially in CentOS),  we will follow my short howto.

1. Ensure you’ve got ntp installed. Run rpm -qa | grep ntp to find out if it already exists on your system and yum install ntp if it is not present.

2. Run ntpdate. On CentOS, you will probably get this error:

[root@server ~]# ntpdate
29 Jan 09:52:54 ntpdate[8463]: no servers can be used, exiting

This means you have to include a server into your request, just like shown below.

[root@server ~]# ntpdate 0.pool.ntp.org
29 Jan 10:08:07 ntpdate[8853]: step time server 213.198.55.2 offset 676.605025 sec

This means my server had a 10-minute time diffrence with the time server. After this command my time has been adjusted.

3. Add time synchronization to your crontab and run it as often as you need.

30 * * * * /usr/sbin/ntpdate -s 0.pool.ntp.org

Will sync your clock every hour; I think is enough to perform synchronization weekly.  Let’s do it.

30 10 5 * * /usr/sbin/ntpdate -s 0.pool.ntp.org

This simple guide will keep your clock synchronized. Have fun!