Spread Linux

Categories


Recent Comments:



FeedWind
FeedWind
Get Linux

Baudizm at Blogged

January 13, 2009

Allow NAT access to Publicly-accessible Internal Services via PFSense

Filed under: Tips and Tricks - baudizm @ 3:42 pm

You now have your nice PFSense firewall connected to the net and your users are happily connected then you decided to put up publicly-accessible network services like a web server. But horror starts to creep in when you found out that your users (or your developers) cannot access your public server using their workstations within your local network.

You tried everything in vain and suddenly felt the urge to scream with all your might.

AAAARRGGGHHH!!!!

As far as you’re concerned, you’ve setup PFSense correctly. You have enabled port forwarding quite perfectly. The web server is running without a hitch. You have your DNS working perfectly. But your users cannot seem to access your internal server using your public IP address or domain..

..then you raised your limp hands in resignation.

Dont despair. It’s really simple.

1. Open your PFSense web gui.

2. Move your mouse over to System, and click Advanced.

System - Advanced

3. Scroll down, and look at the Disable NAT Reflection field. Make sure that it is unchecked.

Disable NAT Reflection

4. Click on Save.

That’s all there is to it! Enjoy!

TechnoratiTechnorati , ,
Site Search Tags: , ,


December 1, 2008

Quick Tip: Use DPKG to replicate between Ubuntu installs

Filed under: Linux, Tips and Tricks - baudizm @ 9:22 pm

This is just a quick tip I’m putting up in replicating existing packages between Ubuntu installs. I tend to keep forgetting how to do it every time I do a total reinstall of my Ubuntu box. The following simple commands will list down all installed packages and export it to a file, copy to a USB thumbdrive, and import later after doing a reinstall/upgrade. In other words, the following steps will automate your package reinstall that will mimic your old Ubuntu install.

hw@myubuntu:~$ dpkg --get-selections > pkginstalled

The above snippet uses the dpkg command with the --get-selections parameter to read the installed packages and dumps them to a plaintext file. You can then proceed and copy pkginstalled to an USB thumbdrive for later, and proceed with the reinstall or system wipeout/upgrade.

After your new system has been reinstalled, instead of manually installing all the applications that you had previously, just do the following commands to automate the process.

hw@newbox:~$ dpkg --set-selections < /media/disk/pkginstalled
hw@newbox:~$ apt-get dselect-upgrade

The above snippet imports the list of packages from the file pkginstalled from /media/disk (USB thumbdrive) or replace it with the path where you copied you package list file. The next command does the actual package installation based on the list of packages imported.

NOTE: If you were using non-official repositories, please add the necessary third-party repo prior to doing the steps mentioned above.

Enjoy!

Technorati Technorati , , , , , , ,
Site Search Tags: , , , , , , ,


November 17, 2008

Track your lost laptop with Adeona

Filed under: Throughout the Web, General OpenSource - baudizm @ 9:47 am

I was doing my daily round of sifting through opensource newsbits when I came across Adeona. According to its creators, it can be described as:

Adeona is the first Open Source system for tracking the location of your lost or stolen laptop that does not rely on a proprietary, central service. This means that you can install Adeona on your laptop and go — there’s no need to rely on a single third party. What’s more, Adeona addresses a critical privacy goal different from existing commercial offerings. It is privacy-preserving. This means that no one besides the owner (or an agent of the owner’s choosing) can use Adeona to track a laptop. Unlike other systems, users of Adeona can rest assured that no one can abuse the system in order to track where they use their laptop.

Adeona is designed to use the Open Source OpenDHT distributed storage service to store location updates sent by a small software client installed on an owner’s laptop. The client continually monitors the current location of the laptop, gathering information (such as IP addresses and local network topology) that can be used to identify its current location. The client then uses strong cryptographic mechanisms to not only encrypt the location data, but also ensure that the ciphertexts stored within OpenDHT are anonymous and unlinkable. At the same time, it is easy for an owner to retrieve location information.

Adeona has builds for Linux, Mac OS X, and Windows ready for download and follow the installation steps should anyone wanna try it out.

Though I currently do not own a laptop or a UMPC (planning to), but this sure is a nice must-have for anybody that does have one or several. I gotta see this for myself.

Technorati Technorati , , , , ,
Site Search Tags: , , , , ,


September 25, 2008

Making Wifi work on MSI Wind UMPC

Filed under: Hard and Soft, Tips and Tricks - baudizm @ 2:06 pm

MSI WindMy CEO just arrived from the U.S. and bought himself this snazzy new sub-notebook from MSI. Yep, its MSI’s latest Wind Notebook. And I’m excited to be able to work with this baby. The boss told me that he’s been having a problem making the Wind connect to his LinkSys WiFi router at home and asked me to take a look.

Upon seeing the Wind, I was amazed at how light it is. Yet under the hood it seems pretty much capable. Check out the specs:

• Intel® Atom™ N270 Processor 1.33 GHz
• Intel® 945GSE+ICH7M Chipset
• 2GB RAM DDR2-667
• Genuine Windows XP Home OEM
• 10” Wide Screen Display
• Convenient Magnifying Capability
• Ergonomic Big-Size Keyboard and Touch Pad
• 120 GB Hard Drive
• Built-in 1.3 Megapixel Webcam
• Built-in 2 Channel Stereo Speakers, and Microphone
• 802.11b / g Wireless Lan with Bluetooth
• Li/Ion 3/6 Battery
• 4 in 1 Card Reader
• ~1.0 Kg weight

The Problem

The MSI Wind is using Realtek 8187SE wireless adapter built-in. When I started tinkering with it, I’m surprised that even though the device was detected, and the driver installed (from the bundled support CD), I can’t seem to make this notebook connect to our wireless router. I’ve decided to download an updated driver for the 8187SE from Realtek’s site and reinstalled the driver. After a reboot, same thing - it can’t find our wireless network.

Ok, I might have overlooked something. Sure thing, the (almost) idiot that I am, forgot to turn the wireless adapter on. The Wind has this (not so obvious) access button to activate your wireless adapter. To activate wireless, press Fn + F11 (Function key plus F11 which has this satellite looking icon). The access button icon was not common compared to other laptops which uses “radio” icons. It looked like a satellite dish thus was overlooked. Upon pressing Fn+F11, I was presented with graphical dialogs on which devices will be enabled. You can cycle from activating WiFi only, WiFi and Bluetooth, or Bluetooth only.

After activating the wireless adapter, our wireless network was identified. I tried connecting but it just cycles and stops. So I reviewed the settings again looking for something that I might have missed. What could have been a shoot-or-miss endeavor turned into a feel-good learning experience. I was reminded again by this activity to always review default settings and change them as much as I can (I know I do when I’m on Linux ).

I opened the properties page for the wireless adapter in order to check some of its settings.

• Open Network Connections
• Right click on the wireless adapter icon and click properties
• In the General tab, click on the Configure button right next to the wireless adapter card list
• In the wireless adapter card properties dialog, I made sure that the following is set:

• 802.11d - Disable
• CCX Max Off-Line Measurement - 0 (Zero)
• CCX Radio Measurement - Enable
• IBSS Default 11b Mode - Enable
• Network Type - Infrastructure
• Wireless Mode - IEEE 802.11b

After changing the settings, I applied all the changes, and let the wireless adapter reinitialize and voila! I’m connected to the wireless network.

A short word of caution though. Your wireless router might not be the same as mine and may use a different encoding and keys. Double check what your wireless router will actually support.

Overall, the MSI Wind seems like a very capable UMPC in my opinion and its screen doesn’t make me squint at all. The keyboard fits quite well. I’m beginning to think of getting one myself (if I have the dough! Save save!)

Enjoy!

TechnoratiTechnorati , , , , , , ,
Site Search Tags: , , , , , , ,


August 20, 2008

Allow outbound FTP through PFSense firewall

Filed under: General OpenSource, Tips and Tricks - baudizm @ 1:30 pm

PFSense is a great tool to have that provides a firewall, traffic shaping capabilities, load balancing and failover, and other features plus fully extensible by way of third party opensource “plugins” and packages that you can install via its web console.

Recently though, some of our devs need to connect via FTP to a remote server. And apparently they’ve encountered some weird problem with FTP:

user@ubuntu:~$ ftp some-server.com
Connected to some-server.com.
220 ProFTPD 1.3.1 Server (some-server.com) [143.44.52.54]
Name (some-server.com:user): ftpuser
331 Password required for ftpuser
Password:
230 User ftpuser logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
500 Illegal PORT command
ftp: bind: Address already in use

ftp>

A little investigation revealed that in order for FTP to work, we need to have the FTP Helper proxy application working on the LAN interface of our PFSense box, then add a firewall rule, more like a “transparent FTP proxy”. If you get my drift.

Let’s do it

1. In PFSense, click on Interfaces, LAN

Click on Interfaces | LAN

2. Make sure that “Disable the userland FTP-Proxy application” is unchecked.

3. Save your setting, and then click “Apply this setting”.

4. We will now add a rule to permit our LAN traffic to access our FTP-Proxy application ports 8000-8030 on 127.0.0.1 . To do so, click on the “+” button at the bottom or at the top, of the list of rules to add your new rule. Make sure that the new rule will be on top of all the other rules.

Click  Firewall

Setup your new rule.

Put the new rule above all other rules.

5. Save your new settings, and apply.

Test your FTP connection.

Enjoy!

Technorati Technorati , , , , ,
Site Search Tags: , , , , ,


May 23, 2008

Looking forward to The Philippine Open Source Summit

Filed under: General OpenSource - baudizm @ 9:05 am

After much wait, the Philippine Open Source Summit has been finally announced and will be held at the Cebu International Convention Center on June 23 and 24, 2008. This is truly significant and very timely for me because this is going to be the largest convention that I will be able to witness, and I’m already working in Cebu using opensource tools on the job.

What’s to look forward to?
Doh! This is “TEH” biggest opensource event to happen in the Philippines. Plus Apache Software Foundation is going to be there with VP Ken Coar speaking about opensource communities. There’s also opensource blogger Matt Asay to talk about opensource business models, and Danese Cooper of OSI talking about opensource deployments.

Philippine Open Source Summit

And yes, exhibitions abound and some breakout sessions on SugarCRM, Adempiere, Pentaho, Drupal, RoR, Eclipse, Maven, Tomcat/Jetty, and MySQL. It’s also going to be the initiation of the Open Source Association and the Philippine Open Source Center. I’m also pretty sure that Dr. Alvin Marcelo and Dr. Francis Sarmiento, both with IOSN will be there and I’d love to meet them.

It’s going to be the best venue to meet and get to know more about the people behind opensource in the Philippines. I’d say I’m not excited. I’m thrilled!

TechnoratiTechnorati , , , ,
Site Search Tags: , , , ,


March 10, 2008

Postfix and Dovecot Authentication through LDAP to eDirectory LDAP

Filed under: Linux, Tips and Tricks, Netware - baudizm @ 10:16 pm

We have been using eDirectory for quite a while on Linux now and the time has come that a client would like to use eDirectory to authenticate other Linux services through LDAP to eDirectory. We have been tasked to integrate the authentication of Postfix, Dovecot, Squid, and SquirrelMail via LDAP to Novell’s eDirectory.

The approach that we have decided to use for Postfix was to do virtual email hosting, while letting Postfix pull user accounts from LDAP, and store the emails on virtual mailboxes in the Linux machine. Dovecot will also do a password lookup, while using a global user account on Linux that will have exclusive access to the “home” directory of virtual email users. Squid will do direct LDAP access via the squid_ldap_auth helper. SquirrelMail on the other hand will just pull off authentication via Dovecot.

I will only be providing the steps on how to authenticate Postfix and Dovecot to eDirectory via LDAP. In order to perform the following outlined steps, it will be helpful to already have Novell eDirectory/NDS running on one server. It must listen on either port 389 or 636 by default. However, if you’ve modified the ports, make sure you take note of them for later use. Also on the eDirectory/NDS, we will need to have one user that will act as a proxy user for LDAP lookups. Though this can also be achieved by assigning [Public] as a Trustee with “browse” rights to the root of your tree (eg. “o=your-context” ). How to install eDirectory on Linux is beyond the scope of this article. Feel free to visit the Novell Documentation.

We have used SuSE Linux Enterprise Server 10 SP 1 to perform all of the steps. It doesn’t matter though which Linux distribution you’ll be using or if you’ll be accessing NDS on Netware, as long as the backend LDAP server will be eDirectory/NDS.

POSTFIX CONFIGURATION

A. main.cf
Postfix already comes with SLES10 SP1 built-in. It only requires a little tweaking to allow it to authenticate to eDirectory via LDAP. We will then throw in virtual email hosting configuration for good measure.

If you need to compile Postfix, configure and compile it as standard. However in the main.cf, we will be adding a couple of parameters to make Postfix work with LDAP. The following parameters are what we need. The rest not included here are standard Postfix configs, including restrictions and UCEs.

inet_protocols = all
inet_interfaces = all
biff = no
mail_spool_directory = /var/spool/mail
myhostname = your-server-hostname
mydomain = put-a-dummy-domain-here.
mydestination = localhost.$mydomain,localhost,$mydomain,$myhostname
mynetworks = 192.168.100.0/24 127.0.0.1
mynetworks_style = subnet

Modify myhostname and mynetworks to reflect your own settings. Put a dummy domain name in mydomain. We will put our real domain in the virtual_mailbox_domains parameter.


local_recipient_maps = ldap:/etc/postfix/ldap-user-auth.cf
local_transport = virtual
virtual_mailbox_domains = your-real-domain-here
virtual_mailbox_base = /var/spool/vmail
virtual_mailbox_maps = hash:/etc/postfix/virtual_mailboxes
virtual_minimum_uid = 106
virtual_uid_maps = static:106
virtual_gid_maps = static:12

local_recipient_maps will point to our LDAP authentication routines contained in ldap-user-auth.cf. virtual_mailbox_domains will have our real domain since we will be using virtual email users that will be pulled off from eDirectory via LDAP later. virtual_mailbox_maps will point to our hash file which is actually a mapping of email addresses to their associated virtual mail boxes relative to the default directory assigned in virtual_mailbox_base.

virtual_uid_maps and virtual_gid_maps will point to the only mail-related user in the entire SLES10 system — the global user which will be used by Postfix and Dovecot to drop emails to the mailboxes of our virtual email users. The global user, in our case is called “vmail” as assigned a uid of 106 and a gid of 12 (mail). It was created using the terminal by typing the following as root:

useradd -u 106 -g 12 -d /var/spool/vmail -s /bin/bash vmail

You will also need to create /var/spool/vmail and change ownership (chown) to vmail:mail.

smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth

Enable SASL authentication by setting smtpd_sasl_auth_enable = yes. We will be using Dovecot SASL therefore, we will need to set smtpd_sasl_type = dovecot and smtpd_sasl_path = private/auth.

B. ldap-user-auth.cf
Here are the things we need to put for LDAP authentication for Postfix.

server_host = your-LDAP-server-ip
search_base = o=context
version = 3
query_filter = (&(objectClass=Person)(uid=%s))
result_attribute = uid

bind = yes
bind_dn = cn=ProxyLDAPUser.o=context
scope = sub

C. virtual_mailboxes
Since Postfix will be looking for “real” users, we will need to map email addresses to actual directory locations for each user using the virtual_mailboxes mapping. Arguments for the mapping will take the form of:

email address username/Maildir

Example:
user1@mydummydomain.com user1/Maildir
user2@mydummydomain.com user2/Maildir
:

Save the file, and generate the Postfix database by running postmap virtual_mailboxes in the terminal.

DOVECOT CONFIGURATION (pertinent only)

A. dovecot.conf
Dovecot can be compiled off the bat using ./configure, and then following it with make and make install respectively. However, since we will be letting Dovecot authenticate through LDAP, we will need to compile it with LDAP support therefore do this by typing ./configure --with-ldap and proceed as usual.

Here are the pertinent parameters that we will need to declare in dovecot.conf to enable it to work with LDAP. The rest of the configs (not shown) are standard Dovecot config.

mail_location = maildir:/var/spool/vmail/%u/Maildir
first_valid_uid = 106
last_valid_uid = 106
auth_username_format = %Lu

auth default {
mechanisms = plain login

passdb ldap {
args = /etc/dovecot/dovecot-ldap_passdb.conf
}

userdb static {
args = uid=106 gid=12 home=/var/spool/vmail/%u
}

socket listen {
master {
path = /var/run/dovecot/auth-master
mode = 0660
user = vmail
group = mail
}

client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = mail
}
}
}

B. dovecot-ldap_passdb.conf

hosts = LDAP-server-ip
base = o=context
ldap_version = 3
scope = subtree

#for LDAP Bind
auth_bind = yes
pass_filter = (&(objectClass=Person)(uid=%u))

Replace LDAP-server-ip with the server ip of the eDirectory server. Replace o=context with your eDirectory context.

VALIDATING
Run Postfix by typing rcpostfix start and run Dovecot by typing /usr/local/sbin/dovecot. You will then be able to try and connect via telnet on port 25, 143 and/or 110 to test Postfix and Dovecot. You can test Dovecot if the user can authenticate by going:

telnet server-ip 143

You will then receive the server header/reply. You can proceed to initiate authentication by going:

1 login user password

If you’ll receive an OK message, congratulations!

You can monitor Postfix by looking at /var/log/mail using the command tail -f /var/log/mail.

Feel free to post your questions and comments. Good Luck!

Technorati technorati tags: , , , , , , , ,


January 30, 2008

Web-based Chat with Webcam (without YM)

Filed under: Tips and Tricks - baudizm @ 9:22 pm

Usually, the most common way to chat and view webcam today is through Yahoo’s own Yahoo Messenger client and its chat service. However, I have to admit their client is nowhere near good on Linux. And yes I have tried the various alternatives but they don’t have direct cam support (hopefully Pidgin will soon.). For this trip that I am on, I am communicating with my family either through SMS or through Gmail’s chat. After four days on the trip, I miss my family and I want to see my baby girl so I decided to teach my wife how to activate and use Ustream.TV’s webcasting system.

I registered an account and gave it to my wife, which I then asked her to follow some steps to use Ustream. For the first night, she didn’t get to make it work. So we left it at that. This evening, I’ve logged into the Ustream account made some changes in the preferences and settings, logged out and asked her to log in. I then asked her to turn the broadcast on, and voila! I can see my wife and baby girl on cam and chat with them too. Though it is on separate windows, I did ourselves the favor of not using Yahoo Messenger, and we saved ourselves some client installation. And guess what? The video latency is almost like that on YM. I chat with my wife on Gmail, and view her and our baby on Ustream. Neat huh?

gmail chat + ustream video

Technorati Tags: , , , , , , ,
Site Search Tags: , , , , , , ,



Get free blog up and running in minutes with Blogsome | Theme designs available here