IT

Linux Software Management with yum 150 150 Roderick Derks

Linux Software Management with yum

In the Linux world, package management systems such as the RPM Package Manager (RPM) and Debian packages have become standard features with most distributions. Package management systems enable easy installs, de-installs, upgrades, and verification of both simple and complex software packages.

The basic tools for both RPM and Debian packages, though, work on individual package files. As Linux distributions have become larger and more complex and as the need for frequent and even automated updates has grown, the limitations of RPM and Debian packages have become apparent.

To fill this void, distribution maintainers have developed tools that either build on existing package systems or scrap them entirely in favor of new systems. Gentoo looked to FreeBSD for the inspiration for its Portage package management, which is network- and source code-based. Debian developers created the Advanced Package Tools (APT) to add network capabilities to Debian packages. In addition to an RPM port of APT, the RPM world has the Yellow Dog Updater, Modified, or Yum, which is similar to APT in basic features and design goals, although it differs in many details.

If you have an RPM-based system, investigating Yum (or APT, if you prefer) is worthwhile. Yum allows you to quickly and easily update the software on your system using network repositories or install entirely new packages.

This article is a copy from www.linux-mag.com, written by Roderick W. Smith. 🙂 Another Roderick..

read more

LDAP commands and scripts 150 150 Roderick Derks

LDAP commands and scripts

This is boring stuff, but needed to build and maintain your ldap directory. read more

Iptables: script to block selected or specific ip addresses 150 150 Roderick Derks

Iptables: script to block selected or specific ip addresses

Here I got this script for you that can help you to secure your server from attackers or bots.
Just add ip addresses you want to block to a file, on each line one, and run the script. Iptables will do the rest. read more

Setup LDAP 150 150 Roderick Derks

Setup LDAP

Using LDAP now… and no,  it is not a drug.  I started to set up LDAP on my home network to get a better understanding of this service. I'm getting there but it takes time.
Using: Fedora 6, openldap. And the Thunderbird email client to look up my email addresses.

read more

Setup Linux as an internet gateway 150 150 Roderick Derks

Setup Linux as an internet gateway

Needed:

  • Computer (Virtual is an option)
  • 2 NIC's
  • ADSL modem
  • linux and iptables

read more

Sendmail security 150 150 Roderick Derks

Sendmail security

Adding some hints here to secure your mailserver. The list will grow in time. 

$ vi /etc/mail/access

# Description showing bellow for the format of this file comes from
# the Sendmail source distribution under “cf/README” file.
#
# The table itself uses e-mail addresses, domain names, and network
# numbers as keys. For example,
#
#        spammer@aol.com                REJECT
#        cyberspammer.com               REJECT
#        192.168.212                            REJECT
#
# would refuse mail from spammer@aol.com, any user from cyberspammer.com
# (or any host within the cyberspammer.com domain), and any host on the
# 192.168.212.* network.
#
# The value part of the map can contain:
#
#        OK           Accept mail even if other rules in the
#                        running ruleset would reject it, for example,
#                        if the domain name is unresolvable.
#        RELAY   Accept mail addressed to the indicated domain or
#                        received from the indicated domain for relaying
#                        through your SMTP server.  RELAY also serves as
#                        an implicit OK for the other checks.
#        REJECT  Reject the sender or recipient with a general
#                        purpose message.
#        DISCARD    Discard the message completely using the
#                        $#discard mailer.  This only works for sender
#                        addresses (i.e., it indicates that you should
#                        discard anything received from the indicated
#                        domain).
#        ### any text    where ### is an RFC 821 compliant error code
#                        and “any text” is a message to return for
#                        the command.
#
# For example:
#
#        cyberspammer.com        550 We don’t accept mail from spammers
#        okay.cyberspammer.com          OK
#        sendmail.org                           OK
#        128.32                                 RELAY
#
# would accept mail from okay.cyberspammer.com, but would reject mail
# from all other hosts at cyberspammer.com with the indicated message.
# It would allow accept mail from any hosts in the sendmail.org domain,
# and allow relaying for the 128.32.*.* network.
#
# You can also use the access database to block sender addresses based on
# the username portion of the address. For example:
#
#        FREE.STEALTH.MAILER@    550 Spam not accepted
#
# Note that you must include the @ after the username to signify that
# this database entry is for checking only the username portion of the
# sender address.
#
# If you use like we do in our “sendmail.mc macro configuration:
#
#        FEATURE(`blacklist_recipients’)
#
# then you can add entries to the map for local users, hosts in your
# domains, or addresses in your domain which should not receive mail:
#
#        badlocaluser            550 Mailbox disabled for this username
#        host.mydomain.com       550 That host does not accept mail
#        user@otherhost.mydomain.com     550 Mailbox disabled for this recipient
#
# This would prevent a recipient of badlocaluser@mydomain.com, any
# user at host.mydomain.com, and the single address
# user@otherhost.mydomain.com from receiving mail. Enabling this
# feature will keep you from sending mails to all addresses that
# have an error message or REJECT as value part in the access map.
# Taking the example from above:
#
#        spammer@aol.com                REJECT
#        cyberspammer.com               REJECT
#
# Mail can’t be sent to spammer@aol.com or anyone at cyberspammer.com.
#
# Now our configuration of access file,
# by default we allow relaying from localhost…
localhost.localdomain           RELAY
localhost                               RELAY
127.0.0.1                               RELAY
192.168.1                               RELAY

$ service sendmail reload 

Howto setup dynamic DNS 150 150 Roderick Derks

Howto setup dynamic DNS

Setup the config files for dhcp and Named. Clients (pc's, laptops) will get an ip address from a range you specified. You can also reserve specific ip address for static devices like serves or printers. The dhcp server daemon registers them to the Named server.

I used Fedore 6, dhcpd and Named running in chroot mode.

Sometimes you get stuck because of problems with rights on the file system or a configuration error in one of your config files. Don't let this bring you down. Stand up straight, keep you head up and hold on till you got what you wanted 😉 

read more

How to change the timezone in linux 150 150 Roderick Derks

How to change the timezone in linux

Most modern Linux distributions have user-friendly programs to set the timezone, often accesible through the program menus or right-clicking the clock in a desktop environment such as KDE or GNOME. Failing that it's possible to manually change the system timezone in Linux in a few short steps.

  1.  Logged in as root, check which timezone your machine is currently using by executing `date`. You'll see something like "Mon 17 Jan 2005 12:15:08 PM PST -0.461203 seconds", PST in this case is the current timezone.
  2. Change to the directory to /usr/share/zoneinfo, here you will find a list of time zone regions. Choose the most appropriate region, if you live in Canada or the US this directory is the "Americas" directory.
  3. If you wish, backup the previous timezone configuration by copying it to a different location. Such as `mv /etc/localtime /etc/localtime-old`.
  4. Create a symbolic link fr om the appropiate timezone to /etc/localtime. Example: `ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime`.
  5. If you have the utility rdate, update the current system time by executing `/usr/bin/rdate -s time.nist.gov`.
  6. Set the ZONE entry in the file /etc/sysconfig/clock file (e.g. "Europe/Amsterdam")
  7. Set the hardware clock by executing: ` /sbin/hwclock –systohc`

Tips

  • On some versions of RedHat Linux, Slackware, Gentoo, SuSE, Debian, Ubuntu, and anything else that is "normal", the command to display and change the time is 'date', not 'clock'
  • On RedHat Linux there is a utility called "Setup" that allows one to select the timezone from a list, but you must have installed the 'redhat-config-date' package.

Warnings

  • Some applications (such as PHP) have separate timezone settings from the system timezone.
  • On some systems, there is a system utility provided that will prompt for the correct timezone and make the proper changes to the system configuration. For example, Debian provides the "tzsetup" utility.

Shit that happens

  • Once I had a "wrong" timezone file. Using the /usr/share/zoneinfo/Europe/Amsterdam file the server refused to move to another timezone and wanted to stay in the Chicago timezone. After copying a Amsterdam timezone file from a working server the problem stopped.
HPUX: restore files from an ignite backup 150 150 Roderick Derks

HPUX: restore files from an ignite backup

# mkdir cd /tmp/restore_etc
# cd /tmp/restore_etc
# mt -f /dev/rmt/0mn rew (terugspoelen)
# mt -f /dev/rmt/0mn fsf 1 (fast forward)
# tar xvf /dev/rmt/0m etc (restore directory)
NO slash preceding "etc"

# cp -R -p -i . /etc/
Don't overwrite exisiting by pushing the N key

Another way:
# tar xvf /dev/rmt/0m etc/aliases (restore single file)
NO slash preceding "etc"

HPUX: Adjust sudo userprofiles 150 150 Roderick Derks

HPUX: Adjust sudo userprofiles

edit sudo userfile:
#visudo
toevoegde regels:
user1  ALL=/usr/sbin/sam, /usr/bin/vi /etc/hosts
user2  ALL=/usr/sbin/sam, /usr/bin/vi /etc/hosts
user3    ALL=/usr/sbin/sam, /usr/bin/vi /etc/hosts 

Edit .profile files of user user1, user2, user3:
alias sam="/opt/iexpress/sudo/bin/sudo /usr/sbin/sam"

This helps the user on the commandline to start SAM.
Root rights for a normal user using sudo on /etc/hosts if you execute the command "sudo vi /etc/hosts".

    Your Name (required)

    Your Email (required)

    Subject

    Your Message

      Your Name (required)

      Your Email (required)

      Subject

      Your Message