Category Archives: Unix

Linux Unix

Unix/Linux for Beginner, list of resources

Some common question I see in Installation of Unix/Linux :

  • What command I should I type?
  • When I can start hacking?
  • When I start learning hacking?
  • Do you have resources for beginner for me?

Not sure, I’m search engine lovers icon smile Unix/Linux for Beginner, list of resources

Here’s the lists :

Books :

  1. Hacking Ubuntu: Serious Hacks Mods and Customizations (ExtremeTech) Unix/Linux for Beginner, list of resources
  2. Google Hacks: Tips & Tools for Finding and Using the World’s Information (Hacks) Unix/Linux for Beginner, list of resources
  3. Knoppix Hacks: Tips and Tools for Using the Linux Live CD to Hack, Repair, and Enjoy Your PC Unix/Linux for Beginner, list of resources
  4. Ubuntu Hacks: Tips & Tools for Exploring, Using, and Tuning Linux (Hacks) Unix/Linux for Beginner, list of resources
  5. Windows XP Hacks, Second Edition Unix/Linux for Beginner, list of resources
  6. Perl Hacks: Tips & Tools for Programming, Debugging, and Surviving (Hacks) Unix/Linux for Beginner, list of resources
  7. PHP Hacks: Tips & Tools For Creating Dynamic Websites (Hacks) Unix/Linux for Beginner, list of resources
  8. Essential PHP Security Unix/Linux for Beginner, list of resources
  9. Linux Server Hacks: 100 Industrial-Strength Tips and Tools Unix/Linux for Beginner, list of resources
  10. SQL Hacks Unix/Linux for Beginner, list of resources
  11. Wireless Hacks: Tips & Tools for Building, Extending, and Securing Your Network (Hacks) Unix/Linux for Beginner, list of resources
  12. BSD Hacks Unix/Linux for Beginner, list of resources
  13. Hack Attacks Revealed: A Complete Reference for UNIX, Windows, and Linux with Custom Security Toolkit, Second Edition Unix/Linux for Beginner, list of resources
  14. Network Security Hacks Unix/Linux for Beginner, list of resources
  15. PC Hacks: 100 Industrial-Strength Tips & Tools Unix/Linux for Beginner, list of resources

Online Resources :

  1. UNIX Tutorial for Beginners, complete reference.
  2. Unix for Beginners, by Uppsala Software Factory
  3. UNIX Help for Users, UNIX Help for Users .
  4. UNIX Frequently Asked Questions (FAQs), often seen in comp.unix.questions and comp.unix.shell.
  5. History of UNIX, read all about the history of its creation.

Last Update : February 12 2008

Unix

Redirect Port in pf.conf

Other team need to access absence url from outside, system need to be setup not more than 10 minutes.

How to reach lan from public access and lock it to specified public ip address only ?

Using redirection is the fastest solution.

For illustration :

We have 3 computer, A, B and C. Each computer has specification.

Computer A, has ip address :

Public : 222.124.4.111

Computer B, has ip address :

Public : 222.124.4.222

Local : 172.88.1.1

Computer C, has ip address :

Local : 172.88.1.10 ( where absence script, apache etc reside)

Objective :

User type address, http://222.124.4.111:8081 and they will get same page as they were access

http://www.oldaddress.com from lan.

Preparation :

Login to computer B via putty and open pf.conf using ee or another editor.

#ee pf.conf

Snippet of pf.conf for that purpose (redirection) :

///////////////////////////////////=============pf.conf==================

#specify interface

EXT = "fxp0"
INT = "em0"

#variable declaration
ip_hosting="222.124.4.222"
ip_lan="172.88.1.10"
ip_public="222.124.4.111"

LAN_clients = "172.88.0.0/16"

TCP_OPTIONS = "flags S/SAFRUP keep state"
icmp_types="echoreq"

set loginterface $EXT
scrub in on $EXT all

rdr on $EXT proto tcp from $ip_public to $ip_hosting port 8081 -> $ip_lan port 80

///////////////////////////////////=============pf.conf==================

save the file.

Stop pf (pfctl -d)

Enable pf again (pfctl -e -f /etc/pf.conf)

Done?

Why I still can’t see the page?

Well, perhaps in computer C you have to set route for lan access to computer B.

just delete existing route will do that magic icon smile Redirect Port in pf.conf

#route delete default

#route add default 172.88.1.1

Common problem that I see when I try this method is forget to check the route icon smile Redirect Port in pf.conf

Testing

Just ask user to test, good luck.

Happy redirecting icon wink Redirect Port in pf.conf

Unix

No ALTQ support in kernel

ftp# pfctl -d

No ALTQ support in kernel
ALTQ related functions disabled
pf disabled

ftp# pfctl -e -f /etc/pf.conf

No ALTQ support in kernel
ALTQ related functions disabled
altq not defined on rl0
altq not defined on rl0
/etc/pf.conf:34: errors in queue definition
pfctl: Syntax error in config file: pf rules not loaded

what happen?

No support for ALTQ in kernel icon smile No ALTQ support in kernel

How to enable that?

Hmm…. in FreeBSD FAQ icon smile No ALTQ support in kernel

I’ve set that in previous version, is it because of recent upgrade that I’ve done?

Yes, you can start from examining your kernel :

ftp# uname -v

FreeBSD 6.3-PRERELEASE #0: Wed Jan  2 13:54:29 WIT 2008

nike@rasyid.net:/usr/obj/usr/src/sys/GENERIC

ups, GENERIC . latest cvsup to RELENG_6 make that happen icon smile No ALTQ support in kernel

Ok, time to see the kernel archives :

ftp# cd /usr/src/sys/i386/conf/

ftp# ls

.cvsignore      GENERIC         Makefile        PAE             TITAN
DEFAULTS        GENERIC.hints   NOTES           SMP             XBOX

ftp# tail -f TITAN

#If you Want ALTQ you will also need these

#ALTQ Support
options         ALTQ
options ALTQ_CBQ        # Class Bases Queueing
options ALTQ_RED        # Random Early Drop
options ALTQ_RIO        # RED In/Out
options ALTQ_HFSC       # Hierarchical Packet Scheduler
options ALTQ_CDNR       # Traffic conditioner
options ALTQ_PRIQ       # Priority Queueing

my bad, I have to reconfigure kernel to use TITAN icon smile No ALTQ support in kernel

ftp# cd /usr/src
ftp# make buildkernel KERNCONF=TITAN
ftp# make installkernel KERNCONF=TITAN

ftp# reboot

sighh….. my bad…my bad.

By the way to enable ALTQ support in kernel add these lines :

#ALTQ Support
options         ALTQ
options ALTQ_CBQ        # Class Bases Queueing
options ALTQ_RED        # Random Early Drop
options ALTQ_RIO        # RED In/Out
options ALTQ_HFSC       # Hierarchical Packet Scheduler
options ALTQ_CDNR       # Traffic conditioner
options ALTQ_PRIQ       # Priority Queueing

Unix

Maia-mailguard, user powered mail spam blocker

"Help, my mail inbox still full of spam, you said that you already set a spam blocker in mail server?"

My friend ask me about his mailbox icon smile Maia mailguard, user powered mail spam blocker

My bad, I don’t socialize how to use maia-mailguard for email user.

Maybe, some of you already know that too but don’t know what to do to minimize spam in your inbox with maia-mailguard.

It’s just quick way to set your preference and dissappointing mail spammer icon smile Maia mailguard, user powered mail spam blocker

1. Login to your maia-mailguard, the address provided by sysadmin.

Username is your current email address.

Password is your current email password.

  Maia mailguard, user powered mail spam blocker

read more »

Unix

/dev/null: No such file or directory

Mayday….mayday, my /dev/null no longer exist help me…..

mknod /dev/null c 2 2
chmod 666 /dev/null

from man of mknod :

c ->      Type of device.  If the device is a block type device such as a
             tape or disk drive which needs both cooked and raw special files,
             the type is b.  All other devices are character type devices,
             such as terminal and pseudo devices, and are type c.

mknod name [b | c] major minor [owner:group]

NAME
     null — the null device

DESCRIPTION
     The null device accepts and reads data as any ordinary (and willing) file
     – but throws it away.  The length of the null device is always zero.

FILES
     /dev/null

Fiuhhhh…… icon wink /dev/null: No such file or directory

Unix

Trying freebsd-update for upgrade FreeBSD 7.0 Beta4 to FreeBSD 7.0-RC1

Trying to upgrade FreeBSD from 7.0 Beta4 to 7.0-RC1

monitor# uname -a

FreeBSD monitor.alamster.net 7.0-BETA4 FreeBSD 7.0-BETA4 #0: Mon Dec 17 13:36:                                                                              40 UTC 2007     three@monitor.alamster.net:/usr/obj/usr/src/sys/GENERIC  i386

monitor# locate freebsd-update.conf

/etc/freebsd-update.conf
/usr/jail/etc/freebsd-update.conf
/usr/jail/usr/share/examples/etc/freebsd-update.conf
/usr/obj/usr/src/share/man/man5/freebsd-update.conf.5.gz
/usr/share/examples/etc/freebsd-update.conf
/usr/share/man/man5/freebsd-update.conf.5.gz
/usr/src/etc/freebsd-update.conf
/usr/src/share/man/man5/freebsd-update.conf.5
/usr/titan/ports/security/freebsd-update/files/Attic/freebsd-update.conf.5,v
/usr/titan/src/etc/freebsd-update.conf,v
/usr/titan/src/share/man/man5/freebsd-update.conf.5,v

monitor# freebsd-update -f /etc/freebsd-update.conf -r 7.0RC1 upgrade

Looking up update.FreeBSD.org mirrors… 1 mirrors found.
Fetching public key from update1.FreeBSD.org… done.
Fetching metadata signature for 7.0-BETA4 from update1.FreeBSD.org… done.
Fetching metadata index… done.
Fetching 2 metadata files… done.
Inspecting system… done.

The following components of FreeBSD seem to be installed:
kernel/generic src/base src/bin src/cddl src/compat src/contrib
src/crypto src/etc src/games src/gnu src/include src/krb5 src/lib
src/libexec src/release src/rescue src/sbin src/secure src/share src/sys
src/tools src/ubin src/usbin world/base world/dict world/doc world/games
world/info world/manpages world/proflibs

The following components of FreeBSD do not seem to be installed:
world/catpages

Does this look reasonable (y/n)? y

Fetching metadata signature for 7.0RC1 from update1.FreeBSD.org… failed.
No mirrors remaining, giving up.

editing /etc/freebsd-update.conf

ServerName update.FreeBSD.org to ServerName update1.FreeBSD.org

failed???

Do I type something wrong : another try after I realized it’s 7.0-RC1 (plus minus)

Fetching metadata signature for 7.0-RC1 from update1.FreeBSD.org… done.
Fetching metadata index… done.
Fetching 1 metadata patches. done.
Applying metadata patches… done.
Fetching 1 metadata files… done.
Inspecting system… done.
Fetching files from 7.0-BETA4 for merging… done.
Preparing to download files… done.
Fetching 59 patches…..10….20….30….40….50…. done.
Applying patches… done.
Fetching 1064 files… done.
/usr/sbin/freebsd-update: cannot open files/.gz: No such file or directory
/usr/sbin/freebsd-update: cannot open files/.gz: No such file or directory
Attempting to automatically merge changes in files… done.

The following file could not be merged automatically: /etc/mail/freebsd.cf
Press Enter to edit this file in vi and resolve the conflicts
manually…

hmmm…. editing freebsd.cf manually. I’ll do later icon smile Trying freebsd update for upgrade FreeBSD 7.0 Beta4 to FreeBSD 7.0 RC1

Unix

FreeBSD 6.3 RC2 is out, happy new year

FreeBSD 6.3 RC2 is out, with two distinct version of FreeBSD 6 and 7 I try to maintain existing servers with this pattern :

1. Upgrade to minor for email server as we need stable operation

2. Upgrade backup server with FreeBSD 7 as we need to use their ZFS capability icon smile FreeBSD 6.3 RC2 is out, happy new year

Your choice is vary icon smile FreeBSD 6.3 RC2 is out, happy new year

Quick iso download for 6.3 RC2 :

Click here (i386)

Source upgrade, just use RELENG_6_3 in cvsup

Full release news, click here.

Eager to try FreeBSD 8, I use vmware first icon wink FreeBSD 6.3 RC2 is out, happy new year

Unix

FreeBSD 7.0 release candidate 1 available

From FreeBSD mailing list :

FreeBSD 7.0 RC 1 available for download.

Some information that might useful for upgrading :

1. Use source, just point cvsup to RELENG_7_0

2. Use freebsd-update utility with two options available :

     1. Minor upgrade

     2. Major upgrade

Ready to grab FreeBSD 7.0 RC1, get now via :

1. Torrent, click here

2. ISO download, click here

New year gift from FreeBSD developer icon smile FreeBSD 7.0 release candidate 1 available

 

 

Unix

/usr/local/etc/rc.d in FreeBSD

How do I make mysql server start  in startup?

How to make apache server start in startup?

How to make ftp server start in startup?

Simply, just installed via ports or package,  in FreeBSD there is relation between /etc/rc.conf and /usr/local/etc/rc.d/

for example :

monitor# cat /etc/rc.conf

usbd_enable="NO"
sshd_enable="YES"
apache_enable="YES"
mysql_enable="YES"
svscan_enable="YES"
linux_enable="YES"
radiusd_enable="YES"

just write service name followed by value, YES or NO

I’m not sure what to write? any hint?

Just go to rc.d and see the details, for example :

monitor# cd /usr/local/etc/rc.d/
monitor# ls

apache          radiusd         snmptrapd
mysql-server    snmpd           svscan.sh

looking for available options for mysql server :

monitor# cat mysql-server | more

# Add the following line to /etc/rc.conf to enable mysql:
# mysql_enable (bool):  Set to "NO" by default.
#                       Set it to "YES" to enable MySQL.
# mysql_limits (bool):  Set to "NO" by default.
#                       Set it to yes to run `limits -e -U mysql`
#                       just before mysql starts.
# mysql_dbdir (str):    Default to "/var/db/mysql"
#                       Base database directory.
# mysql_args (str):     Custom additional arguments to be passed
#                       to mysqld_safe (default empty).

you can add in /etc/rc.conf another option beside : mysql_enable="YES"

like :

mysql_dbdir ="/home/mysql_data"

monitor# cat radiusd

#
# Add the following lines to /etc/rc.conf to enable radiusd:
#
# radiusd_enable="YES"
#

option for FreeBSD startup is in your hand icon smile /usr/local/etc/rc.d in FreeBSD

Unix

NetBSD 4.0 released, grab it while its Hot

Form NetBSD mailinglist :

The  NetBSD  Project  is  pleased  to announce that release 4.0 of the
   NetBSD  operating  system  is now available. NetBSD is a free, secure,
   and  highly  portable Unix-like Open Source operating system available
   for  many  platforms, from 64-bit Opteron machines and desktop systems
   to  handheld  and  embedded  devices.  Its  clean  design and advanced
   features   make   it   excellent   in  both  production  and  research
   environments,  and  it  is  user-supported  with complete source. Many
   applications  are easily available through pkgsrc, the NetBSD Packages
   Collection.

   Major  achievements in NetBSD 4.0 include support for version 3 of the
   Xen  virtual  machine  monitor, Bluetooth, many new device drivers and
   embedded  platforms  based  on ARM, PowerPC and MIPS CPUs. New network
   services  include  iSCSI target (server) code and an implementation of
   the  Common  Address  Redundancy  Protocol.  Also, system security was
   further  enhanced  with  restrictions  of  mprotect(2)  to enforce W^X
   policies,  the Kernel Authorization framework, and improvements of the
   Veriexec  file  integrity  subsystem,  which can be used to harden the
   system  against trojan horses and virus attacks. Please read below for
   a list of changes in NetBSD 4.0.

great, looks like NetBSD developer team laso wanna give Christmas gift icon smile NetBSD 4.0 released, grab it while its Hot

Link to download iso file : click here

Source : mailinglist

Linux Unix

Build email server Tutorials, choose one for You

Every linux distro, unix system or windows server came with smtp system.

But it’s not enough for small home office requirement that need to provide mailbox for their employee.
 

Another solution is signup for web hosting that include mail management such cpanel, whm etc.

If this solution wont fit too, maybe dedicated email server need to build icon smile Build email server Tutorials, choose one for You

A lot of tutorials for building email server in internet that might help you to build email server in learning on demand mode such as :

1. Lifewithqmail, extensive guide to build mail server using qmail as MTA

2. ISP-style Email Service with Debian-Sarge and Postfix 2.1.

3. Virtual Users And Domains With Postfix, Courier And MySQL (Ubuntu 7.10), This document describes how to install a mail server based on Postfix that is based on virtual users and domains, i.e. users and domains that are in a MySQL database.

4. Full Mail Server Solution w/ Virtual Domains & Users (Debian Etch, Postfix, Mysql, Dovecot, DSpam, ClamAV, Postgrey, RBL), This guide describes how to set up a full email solution in Debian Linux (all code is from Debian Etch)

5. Qmailrocks, very popular guide. Support Redhat / Fedora, FreeBSD, Debian, Slackware and Solaris.

6. Secure email servers from scratch with FreeBSD 6.1. Part I and Part II.

7. How to set up a home email server. Redhat guide.

8. Virtual Mailhosting System with Postfix Guide, using gentoo.

9. OpenBSD as a Mail Server, extensive guide using openbsd . Pdf version also available.

10. Build email server at home. Windows guide.

11. Build Your Skills: Set up an SMTP/POP3 mail server with Windows Server 2003. Learn how to set up a very basic POP3 e-mail server in Windows Server 2003 without all the extra features that come with Exchange.

I’ll update the list as I found new url, If you have one and wanna share with us please use comment section.

Last update : 17 December 2007