T'Krin's Realm

My yammerings…

Wednesday, February 2, 2005

Gather Windows/Samba Domain Member IP addresses

I maintain four different windows/samba domains at a university and two different hospitals. The domain member machines are spread across multiple subnets at all three locations and have dynamic addressing. I wanted to periodically scan my machines for open ports to see if anything funny was happening. To do this I needed the IPs of the systems that were connected at any given time. Using smbclient and nmblookup together could give me this information. findsmb would not work because it is limited to your current subnet. Therfore, I wrote a script to gather the IPs of domain members, so that I can scan them w/ nmap or just list them. I must thank rcsu in #samba at Freenode for his help to tweak the code. Thanks rcsu!

smbiplookup.pl

posted by tkrin at 11:26 PM  

Friday, October 8, 2004

Wanna be a Mailman?

The following is a mini-Howto on installing and setting up the mailman, http://www.list.org mailing list server.

It’s benefits include a web based interface to list member accounts and to archives either for the public or private for list members only.

A – INSTALLATION

1 – Download the source located at one of the available locations found at http://www.list.org/download.html and save to your favorite dumping ground and unpack.

2 – Create a user and group w/ the name mailman.

3 – If you are sticking w/ defaults, create the directory /usr/local/mailman and give it the appropriate permissions.

# mkdir /usr/local/mailman
# chown mailman.mailman
# chmod 2775 /usr/local/mailman

4 – Change to the mailman source directory and check out the configure script help info, ./configure --help and also the README.* files that apply to you. In my case, I ran to the following:

$ ./configure --with-mail-gid=nogroup --with-cgi-gid=apache --with-mailhost=host.domain.local --with-urlhost=host.domain.local

This tells mailman what group the mail application is run as, what group the cgi scripts are run as, the hostname added to mailing list names and the hostname part of the URL for the mailman web based tools.

5 – Assuming configure has completed successfully, proceed with compiling the source.

# make && make install

B – CONFIGURATION

1 – Configure Apache to allow mailman’s web based interface to work.

Your Apache config must be edited to allow web based access. To allow this, the following should be added to the appropriate Apache config file:

ScriptAlias /mailman /usr/local/mailman/cgi-bin/
  <directory /usr/local/mailman/cgi-bin>>
    Order Deny,Allow
    Allow from all
    Options ExecCGI +FollowSymLinks
  </directory>

Alias /pipermail/ /usr/local/mailman/archives/private/
  <directory /usr/local/mailman/archives>
    Options +FollowSymLinks
    Order Deny,Allow
    Allow from all
  </directory>

After this has been done, restart your Apache daemon, e.g. # service httpd restart

2 – Setup the cron file for mailman to perform scheduled tasks, such as
– Managing archives
– retrying failed messages
– mail password reminders to list members

This can be done by issuing the two following commands,


# cd /var/mailman/cron
# crontab -u mailman crontab.in

3 – Edit the default files, mm_cfg.py and Defaults.py


# cd /usr/local/mailman/Mailman
# vi mm_cfg.py

Add the following lines:

DEFAULT_HOST_NAME = ‘host.domain.local’
DEFAULT_URL = ‘https://host.domain.local/mailman/’

Also, if you wish your lists not to be advertised, i.e. shown on the listinfo page, add the following:

DEFAULT_LIST_ADVERTISED = No

Defaults.py


# cd /usr/local/mailman/Mailman
# vi Defaults.py

IMAGE_LOGOS = 0
DEFAULT_EMAIL_HOST = ‘host.domain.local’
DEFAULT_URL_HOST = host.domain.local”
DEFAULT_MAX_MESSAGE_SIZE = 500 # KB
DEFAULT_GENERIC_NONMEMBER_ACTION = 3 #3 = Discard
DEFAULT_SUBSCRIBE_POLICY = 2 # 2 = admin approval to subscribe

4 – Create the default mailmain mailing list.


# cd /usr/local/mailman
# bin/newlist mailman
               Enter the email address of the person running the list:
               Initial test password:

5 – Configure your SMTP server, in this case it’s Postfix by adding the following lines to your aliases file.

mailman:              "|/usr/local/mailman/mail/mailman post mailman"
mailman-admin:        "|/usr/local/mailman/mail/mailman admin mailman"
mailman-bounces:      "|/usr/local/mailman/mail/mailman bounces mailman"
mailman-confirm:      "|/usr/local/mailman/mail/mailman confirm mailman"
mailman-join:         "|/usr/local/mailman/mail/mailman join mailman"
mailman-leave:        "|/usr/local/mailman/mail/mailman leave mailman"
mailman-owner:        "|/usr/local/mailman/mail/mailman owner mailman"
mailman-request:      "|/usr/local/mailman/mail/mailman request mailman"
mailman-subscribe:    "|/usr/local/mailman/mail/mailman subscribe mailman"
mailman-unsubscribe:  "|/usr/local/mailman/mail/mailman unsubscribe mailman"

Then run the following to have Postfix see the changes.

 # cd /etc/postfix
 # postalias aliases
 # postfix stop
 # postfix start

C – USING MAILMAN

1 – Point your browser of choice to http://host.local.domain/mailman/admin/mailman/ to see the administrative pages for your new list. From here you can make many configuration changes, which is outside the scope of this mini-howto.

2 – Point your mailing list members to http://host.local.domain/mailman/listinfo/mailman for them to see their available options.

3 – You can check various logs at /usr/local/mailman/logs. If you have any problems, some valuable info may be found here.

4 – More specific documentation can be found at http://www.list.org/docs.html.

Well, this is somewhat terse and is also a first draft, so an error or two may exist, but hopefully it may help someone.

Enjoy….

posted by tkrin at 6:56 AM  

Friday, August 20, 2004

Dual booting Linux and Windows using LILO

with a slight twist. In preperation for CTCon5 WTF, I decided to setup a windows install on my Linux only laptop.

I installed windows to a spare drive in a spare laptop. I then transfered that the drive to a modular bay caddy and put it in my laptop. The typical dual boot setup is to have the Windows install be on /dev/hda or /dev/sda, but in my case it will be /dev/hdc.

I use LILO, version 22.5.9, as my boot loader. I have used GRUB but LILO has always worked so I stick with it. To get this particular setup working, the system needs to be ‘faked out’ to think that /dev/hdc is the primary boot device, /dev/hda. This can be done using the boot-as option in /etc/lilo.conf. This results in a section for the Windows installs as follows:



other = /dev/hdc1

table = /dev/hdc

label = windows

boot-as=0x80

In my case the LILO boot loader is installed on /dev/hda, which is typical, therefore, the boot-as option must specify the BIOS device code for that hard drive, in my case 0×80.

With that entry in /etc/lilo.conf you run the /sbin/lilo command to commit the changes. From now on you can now boot the Windows install that is on the removeable hard drive. Bada bing, bada bang. :)

posted by tkrin at 9:35 PM  
« Previous Page

Powered by WordPress