Google
 

Linux Distro Counter

Welcome to Open Source Software and Linux Blog.

Hi, everyone!. I just created this blog to share knowledge about open source software and Linux. If you all have knowledge and info related to open source / Linux, please share or send me an email. Thanks ^_^
Showing posts with label How to. Show all posts
Showing posts with label How to. Show all posts

Thursday, July 24, 2008

How to bridge your NIC on OpenBSD








Firstly, I'm very sorry because not posting in this blog for along time. This is because I'm quite busy for the ISO preparation in my company.

This is the how to for NIC bridging on OpenBSD:

1. Make sure you know what is your ethernet card by your OS such as eth0, em0 or etc. To look just use this command

ifconfig -a

2. For example you NIC is em0 and em1.

3. Create the file name hostname.em0, hostname.em1 and bridgename.bridge0 in /etc directory

4. Put word up in hostname.em0 and hostname.em1. Put sentence add em0 add em1 up in bridgename.bridge0.

5. restart you network by command

sh /etc/netstart

6. Finish

Easy right? Enjoy!

Tuesday, November 20, 2007

How to: Easy Intrusion Detection System (IDS) setup with EasyIDS


Last day, my boss ask me to install one IDS for our office. He just say "Please install the open source product". After seek on the internet for whole day, I found the EasyIDS. I have tested on my office's PC with details:

Pentium 4 2.8ghz
512MB DDR-RAM
40GB Hard disk
2 Network interface card (10/100baseT)
52X CD-ROM

This is the way I do it:
1. Download from the EasyIDS website http://www.skynet-solutions.net/easyids/

2. The download file is on ISO type which mean you can burn it to CD.

3. After burn on the CD, I just install the software with the CD-ROM boot first. You can setting the CD-ROM boot first in your BIOS setting.

4. I just follow the step by step until finish.

5. After it restart and update the patches, it display tty1 as the default with the black and white screen. You can login as root here.

6. After the EasyIDS properly setup you can go to another PC and open the browser. Type http://youreasyIDS. Its will popup the username and password. The default login is admin and the password is password.

7. After login, you see the interface base on ACID which some people call php-acid. This interface is easy to administrating the EasyIDS. I'm so glad this kind of software have develop by open source community. Thanks.

You can go to EasyIDS website http://www.skynet-solutions.net/easyids/ for more details.

EasyIDS Features:
Base on Centos 4.5
Snort
BASE
ACID
Oinkmaster
ntop

Thanks for EasyIDS team for develop this tools. Keep it up! :-)

Friday, October 19, 2007

How to block root to access ssh to your server (CentOS 5)

1. First open your terminal
2. vi /etc/ssh/sshd_config
3. Find PermitRootLogin yes
4. Change PermitRootLogin no
5. Save and exit
6. Restart your sshd by type /etc/init.d/sshd restart

That's all.

Wednesday, October 3, 2007

How to give MySql Root Password

As default, Mysql database didn't have any password. For some security reason, you need give the Mysql with a password. This is the way how to give the password to your Mysql database.

1. Go in to Mysql by type mysql

2. Type update user set password=password ('yourpassword') where user='root'; and enter. yourpassword mean enter your own password.

3. Type flush privileges

4. Exit mysql

To test:

1. Go in to Mysql by type mysql -u root -p and enter

2. It promt you to enter the password. Enter you password given before.

3. If you can login with you password, it mean your work is successfully.


Error after install Phpmyadmin

Last day my friend had asked me about the error after install phpmyadmin in his Linux.

The error say
"The configuration file now needs a secret passphrase (blowfish_secret)"

This is the solution:
1. Go to phpmyadmin directory on your linux. Eg: /usr/share/phpmyadmin (in Centos5).

2. File the config.inc.php with your favorite editor eg. vi

3. Find $cfg ['blowfish_secret'] = ' ';

4. Fill in the password or phassphrase, example
$cfg ['blowfish_secret'] = ' 123456';

5. Save and quit the editor. That all


Thursday, September 6, 2007

How to: Resetting Mysql root password

Sometimes, you cannot remember the mysql password. After try many time to login, you still cannot login to database. This is the solution.

1. You need to open 2 terminal/shell.

At terminal 1:
2. At terminal 1, stop your mysql deamon if it running: $ /etc/init.d/mysqld stop and enter. The mysql deamon is stop now.
3.
Type $ mysqld_safe --skip-grant-tables


Terminal 2:
4.
Change root password to new password: mysql> update user set password=password('newpassword') where user='root';
5. Flush mysql privileges: mysql> flush privileges;
6.
Exit mysql: mysql> exit
7. Restart mysql: $ /etc/init.d/mysqld start

After finish all process, go to your terminal 1 and press Ctrl-C on your keyboard.

Thats all.


Tuesday, August 28, 2007

How to: Install Network Monitoring Tool (Nagios+Nagmin+Webmin+Mysql+Apache2+RRDTool+NMAP) on OpenSUSE 10.2

These are step by step how to setup network monitoring tool on OpenSUSE 10.2:

Install MySql, RRDTool, NMAP and Apache2:
1. Open the YaST software management. Select package mysql, mysql-client, mysql-shared, rrdtool, nmap and apache2. (*Accept all dependencies)
2. After install all package run this command mysqladmin -u root password "yourpassword"
3. Start mysql by run this command rcmysql start
4. Make this service automatically start after reboot by type chkconfig mysql on
5. Start apache2 by typing rcapache2 start
6. Make apache2 auto start after reboot by typing chkconfig apache2 on

Install Webmin:
1. Download webmin from webmin.com. I recommend you to download the noarch package for support all machine architecture. Save it, such as at your desktop.
2. Go to your desktop and type rpm -Uvh webmin_name
3. Start webmin by typing /etc/init.d/webmin start
4. Log in to webmin interface by opening your browser and type https://localhost:10000

Install Nagios:
1. Open YaST and select libcrypt, perl-Net-SNMP, fping, postgresql-libs, radiusclient, apache2, gd, and perl-URI.
2. Download nagios package (
nagios-2.5-24.i586.rpm, nagios-nrpe-2.5.2-28.i586.rpm , nagios-nsca-2.5-39.i586.rpm , nagios-plugins-1.4.5-5.i586.rpm , nagios-plugins-extras-1.4.5-5.i586.rpm , nagios-plugins-sap-ccms-0.7.3-38.i586.rpm and nagios-www-2.5-24.i586.rpm )
at http://download.opensuse.org/distribution/10.2/repo/oss/suse/i586/.
I recommend use nagios version 2.5 because most stable and many package are supported.
3. Install all these packages by typing rpm -Uvh nagios*.rpm
4. Start nagios by typing rcnagios start
5. Make nagios autostart after reboot by type chkconfig nagios on
6. Check your nagios by typing http://localhost/nagios/ on your browser (firefox etc)

Install Nagmin:
Nagmin is a webmin module. To install:
1. Download nagmin from http://sourceforge.net/project/showfiles.php?group_id=77010
I recommend you to download nagmin-2.1.0.tar.gz . It is because easy to install by a setup script. Other nagmin doesn't have a setup script.
2. Extract the nagmin by typing tar xvzf yournagminname .
3. Go to the nagmin folder and type ./setup to intall. Follow this guide

Database name to use or create : [Enter]
Nagios Root directory
: /etc/nagios
[Enter]
Nagios ETC directory
: /etc/nagios [Enter]
Nagmin root directory
: [Enter]
Nagios Configuration File: :
[Enter]
CGI Configuration File:
: [Enter]
Entries will be displayed for accuracy, select Y to continue.
Script will continue with its process.
Select N to question for viewing the SQL file
Select Y to other question

4. Now acces webmin and install the Nagmin plugin

Configure Nagmin setting:
Configure Nagmin Nagios by clicking Module Config in webmin. Change the configuration to the following value:
Nagios BIN directory /usr/bin
Nagios ETC directory /etc/nagios
Nagios LIBEXEC directory /usr/lib/nagios/plugins

5. Open your terminal and type vi /etc/nagios/cgi.cfg
find use_authentication=1; chage 1 to 0
find default_user_name = user, chage the user by deamon

6. Save and quit.

7. Now install NagMin module for webmin. To install go to Webmin --> Webmin Configuration --> Webmin Modules. Install the nagmin module from the nagmin folder that you extract before. The file name is look like
nagmin-2.x.x.wbm

The Error
1. (Error: version issue):
Some error found when your login webmin --> Server --> nagMIN Network Monitoring.

Error message:
The MySQL client program /usr/bin/mysql does not appear to be the correct version. Webmin only supports MySQL versions 3 and above.

The command /usr/bin/mysql -V returned :

/usr/bin/mysql  Ver 14.12 Distrib 5.0.22, for redhat-linux-gnu (i686) using readline 5.0
Suggested fix:
open terminal and type vi /usr/libexec/webmin/nagmin/index.cgi
find "distrib" and add "| 5" after 4 at same line
save and quit the vi.

2.
error found when your login webmin --> Server --> nagMIN Network Monitoring --> in column System Databases --> nagios

error message:
"Error - Perl execution failed
Can't use an undefined value as a HASH reference at /path/to/mysql.pm line 113"
Suggested fix:
Location mysql.pm on Suse /usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi/DBD/mysql.pm

At around line 109 of mysql.pm:

------------------------------------
# Avoid warnings for undefined values
$username ||= '';
$password ||= '';

# create a 'blank' dbh
my($this, $privateAttrHash) = (undef, $attrhash);
$privateAttrHash = { %$privateAttrHash,
'Name' => $dsn,
'user' => $username,
'password' => $password
};
-------------------------------------

Needs to be changed to

-------------------------------------
# Avoid warnings for undefined values
$username ||= '';
$password ||= '';
$attrhash ||= {};

# create a 'blank' dbh
my($this, $privateAttrHash) = (undef, $attrhash);
$privateAttrHash = { %$privateAttrHash,
'Name' => $dsn,
'user' => $username,
'password' => $password
};

Finish.

Friday, August 17, 2007

Job scheduler (Crontab) for Linux

Crontab is a tool for scheduling tasks for the computer to run. It will automate the jobs that needs to be done but will be difficult to be done by human because of time limitation. There are only 4 options for crontab which are -u, -e, -l and -r and the usage is described below:

  • crontab -l - list all the crontab on standard output
  • crontab -e - edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables
  • crontab -r - remove the current crontab
  • crontab -u - specify the user
    • example: $ crontab -u username -l - this command will list the crontab belongs to the username
Crontab is set by running the crontab -e command and add the necessary time and the command to be run on that particular time. Crontab scheduling format are as below:

* * * * * command to be run

1st * is for minutes (0-59)
2nd * is for hour (0-23)
3rd * is for day of month (1-31)
4th * is for month of year (1-12)
5th * is for day of the week (0-7) where 0=Sunday and 7=Sunday

Example:
To backup your pc using rsnapshot everyday at 7.30 a.m.;
  1. Open terminal and type crontab -e
  2. In crontab area type; 30 7 * * * /usr/local/bin/rsnapshot daily
  3. save your crontab setting and exit

Monday, August 13, 2007

How to: Know your mysql and php is connect properly

How to know your mysql and php is connect properly. From my experience I like to share this knowledge.

1) Install the php and mysql in Linux properly with common configuration.
2) Create user and set the password in your database.
2) Create a php file like testdb.php and follow this code. Save it and transfer this file to your webroot. For examples on redhat base is /var/www/htdocs/html or Suse /srv/www/html.
3) Open your browser and type such as http://localhost/testdb.php

If success, the result will show you like
Connecting... Using training2

Friday, August 10, 2007

How to: Install Network Storage Server on CentOS 5 (Samba)

This is the step to install Samba Server on CentOS 5.

1) Open your terminal and login as root

2) type yum install samba and wait until it complete install.

3) Edit /etc/samba/smb.conf with your favorite editor like vi

4) Find workgroup = (yourgroup), server string = (your description), security = share.

5) Go to the bottom of smb.conf and remove ; to enable the purpose.
;[myshare]
; comment = Mary's and Fred's stuff
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
; writable = yes
; printable = no
; create mask = 0765

example:

[marketing_sharing_file]
comment = Saled Item
path = /home/marketing_department
; valid users = nobody
guest ok = yes
writeable = yes
; printable = no
create mask = 0777

After you edit, save and exit.

Thats all. Easy!


Wednesday, August 8, 2007

How to: Complete Install Simple Mail Server in 30 minute including webmail

This is some guide to install mail server in 30 minute. That easy!

1) List of software that you need to install.
a. Postfix for MTA
b. Dovecot for IMAP/POP3 support
c. SquirrelMail for webmail
d. Webmin for web base administrator

2) Install CentOS 5 as common
At (I suggest you tick)
Development package
Develoment lib
Development tools
Gnome Software development
Java development
Legacy software
X software Development
Server
Mail server
-postfix
-Dovecot
-SquirrelMail
-Thunderbird
Server configuration
Webserver
Base System
Base
X windows system

and follow the Centos installation step until finish.

3) Login you the CentOS 5 as root. Install webmin for easy administration soon
rpm -Uvh (your_webmin_package.rpm)

4) After that, open terminal and start this process. (postfix, dovecot, httpd)

5) After you restart the services, test you postfix. To test follow this step:
a. open terminal
type:
telnet localhost 25
EHLO localhost
MAIL FROM: (your email address eg: skymack@foodmalaysia.net)
RCPT TO: (recipient address)
DATA
(type your message here)
.
QUIT

OR

telnet foodmalays.net 25
helo foodmalaysia.net
mail from: sender@foodmalaysia.net
rcpt to: recipientname@mydomain.com
data
subject: (you email title)
to: recipientname@mydomain.com
Write the message here
.

quit

6) After testing you postfix running succesfully, open you webmin eg:
http://localhost:10000 with your browser.
Login to your webmin and go to servers --> Dovecot IMAP/POP3 Server. Select Networking & protocol --> serve mail protocol --> (press ctrl on you keyboard) and select IMAP and POP3. Save it.

7) Create user:
Open terminal. Type
useradd -m (youruser) and enter.
To give password:
passwd (youruser) and enter

8) Open your internet browser and type,
http://localhost/webmail and you will go directly to your webmail (squirrelmail). Fill in you username and password that you created before.

9) Try to send your email to you own name. If it receive the mail its consider your email server is successfully installed.

10) To setup email server and live for world, you must go to setup DNS server, change the server name and get the fix IP number. That all.

Tuesday, July 17, 2007

How to install Automatix2 on Feisty Fawn(Ubuntu 7.04)

These is the easy step to install Automatix on Ubuntu 7.04:

1. Go to this link http://www.getautomatix.com/wiki/index.php?title=Installation










2. Select your machine architecture. For this example, I choose 2.1 Ubuntu 7.04 (Feisty i386) because my machine is i386 base architecture.

3. Click on
http://www.getautomatix.com/apt/dists/feisty/main/binary-i386/automatix2_1.1-4.11-7.04feisty_i386.deb
to download the software. See picture.









4. The package installer will pop up like picture below. Choose the default. Open with Gdebi Package Installer













5. Wait until finish. To open Automatix2, go to your desktop and click on Application --> System Tools --> Automatix

Thats all. Easy!

Wednesday, June 13, 2007

How to get Open Office


Get open office for your office production. Open Office is multiplatform and multilangual office suite and an open-source project.

These is the relate product of Open Office with Microsoft Office product.

Writer ---> Ms Word
Impress ---> Ms Powerpoint
Calc ---> Ms Excel
Base ---> Ms Access

To get and download Open Office please go to http://download.openoffice.org/index.html

Go to http://www.openoffice.org/ for detail. Thats all

How to know your Linux version?

Hi, do you know what version exactly you use? This is the step:

Easy way.
  1. On consonle just type cat /etc/issue.net and enter.
  2. Its will promt something like picture below. Easy!

Others way:
For Ubuntu:
cat /etc/lsb-release

For Redhat:
cat /etc/redhat-release

For SuSE:
cat /etc/SuSE-release

This line will be displayed something like below (like Ubuntu):

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=6.10
DISTRIB_CODENAME=edgy
DISTRIB_DESCRIPTION="Ubuntu 6.10"

Monday, June 11, 2007

How to install GNOME desktop on console (CentOs 5)

To install GNOME desktop on console, just type this command:

  1. Login as root
  2. Type 'yum install groupinstall gnome-desktop' without ' '.
  3. Wait until it finish download and installed.
Thats it. How easy is it?

Friday, June 1, 2007

How to get OpenCD

OpenCD disc

OpenCD is a collection of high quality Free and Open Source Software. The programs run in Windows and cover the most common tasks such as word processing, presentations, e-mail, web browsing, web design, and image manipulation. OpenCD include only the highest quality programs which have been carefully tested for stability, and which we consider appropriate for a wide audience.

Check the latest series:
http://www.theopencd.org/

To download:
http://www.theopencd.org/download

To purchase:
http://www.theopencd.org/purchase

That's all. Enjoy!

Wednesday, May 30, 2007

How to mount CD-ROM in console (no GUI)

Not everybody using a latest PC or Server. Some administrator prefer to install linux without GUI (just console) at old server/PC to run it smoothly. This is the way how to mount cd-rom on console.

1. Go to /mnt with this command
:~# cd /mnt

2. Create directory 'cdrom' with command:
:~# mkdir cdrom

3. Run this command
:~# mount /dev/cdrom /mnt/cdrom

How to check the mount process is success:

1. Insert the cd into cd-rom drive
2. Go to /mnt/cdrom with this command and list it to see what contents in your cd.
:~# cd /mnt/cdrom
:~# ls

That's all.

Wednesday, May 23, 2007

How to look IP address in Linux and Windows(not opensource software)

To look IP address in Linux:
1. Open terminal
2. Type "ifconfig" without "". It's will show like picture below:


To look IP address in Windows:
1. Open Windows command prompt
2. Type "ipconfig". It's will show like picture below:



The defferences is linux use "ifconfig" and windows "ipconfig" ^_^

How to implement a hosts.allow and hosts.deny (tcpwrappers)

To make your server block and allow some deamon process like sshd, ftpd and etc; use this configuration:

1. Open terminal
2. su - if you not a root user
3. Use your favorite editor like vi or nano. In this case I use vi editor.
4. Type "vi /etc/hosts.deny" without "".
5. At the buttom line just type "ALL:ALL:deny" to restricted all of deamon process
6. Save it.
7. Open "/etc/hosts.allow" with vi editor
8. At the buttom line "ALL:(some ip that you allow):allow" to allow anything from my IP address
9. Save it.

Done.

You can test to use sshd or ftpd to the server from others pc/server.

Tuesday, May 22, 2007

How to make sure your pc are use HyperThreading processor on Linux?

To make sure you PC or server running on HyperTreading processor is easy. This is the best way; even though you have utility software to check it.

1. Open your terminal
2. login as root if you not on root user. Use "su -" without "" command to login as a root.
3. Type "top" without ""
4. Press button 1 on your keyboard and you will see such as picture below.