Category Archives: Unix

Unix

Looking up update.FreeBSD.org mirrors… none found.

I often to see that message but finally I found my mistake icon smile Looking up update.FreeBSD.org mirrors... none found.

My mistake is….

I try only once, think if the chance not succeed in first attempt it means I fail.

Definitely wrong :

email# freebsd-update fetch
Looking up update.FreeBSD.org mirrors… none found.
Fetching public key from update.FreeBSD.org… failed.
No mirrors remaining, giving up.
email# freebsd-update fetch
Looking up update.FreeBSD.org mirrors… none found.
Fetching public key from update.FreeBSD.org… failed.
No mirrors remaining, giving up.
email# freebsd-update fetch
Looking up update.FreeBSD.org mirrors… 1 mirrors found.
Fetching public key from update1.FreeBSD.org… done.
Fetching metadata signature for 6.3-RELEASE from update1.FreeBSD.org… done.
Fetching metadata index… done.
Fetching 2 metadata files… done.
Inspecting system… done.
Preparing to download files… done.
Fetching 14 patches. done.
Applying patches… done.
Fetching 14 files…

Fu..fu..fu, my fault guys icon smile Looking up update.FreeBSD.org mirrors... none found.

Ready for freebsd-update install command.

Linux Unix

Unknown setting: mail_privileged_group

Downgrade dovecot to 1.0.10 give me error :

mail# /usr/local/etc/rc.d/dovecot start
Starting dovecot.
Error: Error in configuration file /usr/local/etc/dovecot.conf line 262: Unknown setting: mail_privileged_group
Fatal: Invalid configuration in /usr/local/etc/dovecot.conf

Find line 262, talk about mail_priveleged_group

solution :

change
mail_privileged_group = mail

into

mail_extra_groups = mail

and start dovecot service.

Work icon smile Unknown setting: mail privileged group

Linux Unix

Could not determine the server’s fully qualified domain name

Thats message appear when I try to start apache using apachectl.

#apachectl start
[Thu Jun  5 16:31:33 2008] [alert] httpd: Could not determine the
server’s fully qualified domain name
, using 127.0.0.1 for ServerName
/usr/local/sbin/apachectl start: httpd could not be started

to solve this problem I need to know hostname and edit /etc/hosts to put that information (fully qualified name).

1. Find hostname

proxysudirman# uname -a

2. Edit /etc/hosts entry

proxysudirman# ee /etc/hosts

::1                     localhost localhost.my.domain
127.0.0.1               localhost localhost.my.domain

127.0.0.1               proxy proxysudirman.rasyid.net

172.88.1.2              proxy2 proxysudirman2.rasyid.net

3. Start apache service

proxysudirman# apachectl start
/usr/local/sbin/apachectl start: httpd started

Done icon smile Could not determine the servers fully qualified domain name

Unix

uplcom, ucom and itegno on FreeBSD 7

New Itegno 3000 has arrived, plug it in my Windows XP working well. I wanna try in FreeBSD 7 server.

Here’s the steps :

1. Detection Modem

Activate uplcom

monitor# kldload uplcom

See detected modul in kernel:

monitor# kldstat
Id Refs Address    Size     Name
 1   13 0xc0400000 9118d4   kernel
 2    1 0xc0d12000 6a618    acpi.ko
 3    1 0xc3207000 3000     pflog.ko
 4    1 0xc321a000 33000    pf.ko
 5    1 0xc32a6000 22000    linux.ko
 6    1 0xc5473000 4000     uplcom.ko
 7    1 0xc5477000 3000     ucom.ko

Plug modem now and see  :

monitor# tail -f /var/log/messages

Apr 29 09:59:14 monitor root: Unknown USB device: vendor 0x0eba
product 0×1080 bus uhub1
Apr 29 09:59:14 monitor kernel: ugen0: <Prolific Technology Inc.
USB-Serial Controller, class 0/0, rev 1.10/0.01, addr 2> on uhub1

monitor# dmesg | tail

ugen0: <Prolific Technology Inc. USB-Serial Controller, class 0/0, rev
1.10/0.01, addr 2> on uhub1

Looking for position :

monitor# usbdevs -a 2 -v
Controller /dev/usb0:
Controller /dev/usb1:
addr 2: full speed, power 500 mA, config 1, USB-Serial
Controller(0×1080), Prolific Technology Inc.(0x0eba), rev 0.01
Controller /dev/usb2:

So far so good but I try to unplug and find it as ucom but still not lucky icon sad uplcom, ucom and itegno on FreeBSD 7

Try this way still the same, maybe I’ll try Linux first.

Unix

Install FreeBSD 6.3 stable and 8.0 current inside FreeBSD 7 Stable

Time is up, I must set a server for my staff for their learning needs, they want root account. Not sudo icon smile Install FreeBSD 6.3 stable and 8.0 current inside FreeBSD 7 Stable

After seeing more in internet I came across to jail solution. See in internet for more practical examples and put them in a list here.

Due to limited hardware I install new machine with this flow :

1. Install FreeBSD 7 stable (get latest snapshot April 2008)

Full Video and link for download video files.

2. Inside FreeBSD 7 I install FreeBSD 8 current  (from snapshot April 2008).

Full video and link for download video files.

3. Install FreeBSD 6.3 stable inside FreeBSD 7 (from snapshot April 2008).

I download iso and mount it in /mnt :

home# ls

.cshrc                 .profile
.k5login                                6.3-STABLE-200804-i386-disc1.iso
.login                                  minichroot.sh

home# mdconfig -a -t vnode -f 6.3-STABLE-200804-i386-disc1.iso  -u 0

home# mount -t cd9660 /dev/md0 /mnt

home# cd /mnt

home# ls

.cshrc                  RELNOTES.HTM            media
.profile                RELNOTES.TXT            mnt
6.3-STABLE-200804       bin                     proc
COPYRIGHT               boot                    rescue
ERRATA.HTM              boot.catalog            root
ERRATA.TXT              cdrom.inf               sbin
HARDWARE.HTM            dev                     stand
HARDWARE.TXT            docbook.css             sys
INSTALL.HTM             etc                     tmp
INSTALL.TXT             floppies                usr
README.HTM              lib                     var
README.TXT              libexec

download miniroot.sh from ultradesic.

Modify /usr/jail/root/.cshrc and /usr/jail2/root/.cshrc .

Add this  :

set prompt = "FreeBSD8 %~ %# "

to let me know where I’m icon smile Install FreeBSD 6.3 stable and 8.0 current inside FreeBSD 7 Stable

Video for install FreeBSD 6.3 and link to download video files.

Unix

101 FreeBSD jails

I just love ‘jail’ in FreeBSD, so many possibilty I can achieve with jails.

I try to collect some links that I think useful :

1. Creating and Managing A Jailed Virtual Host in FreeBSD

2. djbDNS using FreeBSD jails

3. Jails and EZJail

4. Creating a FreeBSD Jail

5. Jailing MySQL and PostgreSQL on FreeBSD

6. Using a FreeBSD jail as a ports build cluster

7. Multiple Ip’s on FreeBSD 6.1-p3 jail

8. Security, Process Isolation and Virtual Hosting with FreeBSD Jails

9. Mailfilter FreeBSD Jail

10. ezjail – A jail administration framework

11. The Quick-N-Dirty Guide to ezjail in FreeBSD

12. Managing Jails

13. Install FreeBSD 6.3 stable and 8.0 current inside FreeBSD 7 Stable

not 101 in fact but I like to use that icon wink 101 FreeBSD jails

On progress, help me a lot in learning FreeBSD jail icon smile 101 FreeBSD jails

Last Update : July 8 2008

Unix

Updating My 6.3 release box

Use src for many times make me get surprised when using freebsd-update for fix is very easy. Simple though.

mail# freebsd-update fetch
Looking up update.FreeBSD.org mirrors… 1 mirrors found.
Fetching metadata signature for 6.3-RELEASE from update1.FreeBSD.org… done.
Fetching metadata index… done.
Fetching 2 metadata patches.. done.
Applying metadata patches… done.
Inspecting system… done.
Preparing to download files… done.
Fetching 9 patches….. done.
Applying patches… done.

The following files will be updated as part of updating to 6.3-RELEASE-p2:
/lib/libpthread.so.2
/usr/lib/libpthread.a
/usr/lib/libssh.a
/usr/lib/libssh.so.3
/usr/sbin/sshd
/usr/src/crypto/openssh/channels.c
/usr/src/lib/libpthread/sys/lock.c
/usr/src/lib/libpthread/thread/thr_kern.c
/usr/src/sys/conf/newvers.sh

mail# freebsd-update install
Installing updates… done.
mail#

Cool!

Unix

OpenSSH X11-forwarding privilege escalation

Just update the box with this issue :

FreeBSD-SA-08:05.openssh                                    Security Advisory
                                                          The FreeBSD Project

Topic:          OpenSSH X11-forwarding privilege escalation

Category:       contrib
Module:         openssh
Announced:      2008-04-17
Credits:        Timo Juhani Lindfors
Affects:        All supported versions of FreeBSD
Corrected:      2008-04-16 23:58:33 UTC (RELENG_7, 7.0-STABLE)
                2008-04-16 23:58:52 UTC (RELENG_7_0, 7.0-RELEASE-p1)
                2008-04-16 23:59:35 UTC (RELENG_6, 6.3-STABLE)
                2008-04-16 23:59:48 UTC (RELENG_6_3, 6.3-RELEASE-p2)
                2008-04-17 00:00:04 UTC (RELENG_6_2, 6.2-RELEASE-p12)
                2008-04-17 00:00:28 UTC (RELENG_6_1, 6.1-RELEASE-p24)
                2008-04-17 00:00:41 UTC (RELENG_5, 5.5-STABLE)
                2008-04-17 00:00:54 UTC (RELENG_5_5, 5.5-RELEASE-p20)
CVE Name:       CVE-2008-1483

For general information regarding FreeBSD Security Advisories,
including descriptions of the fields above, security branches, and the
following sections, please visit <URL:http://security.FreeBSD.org/>.

Just use freebsd-update start by :
freebsd-update fetch
freebsd-update install

Patch set icon smile OpenSSH X11 forwarding privilege escalation 

Unix

The Best of FreeBSD Basics

[amazonify]0979034221:right[/amazonify]

Simple still simple, hide complex  things within  sleek  procedure is great  icon smile The Best of FreeBSD Basics

Thats main reason why I use FreeBSD, as review in Amazon :

For over seven years, computer networking and security instructor and consultant, Dru Lavigne, meticulously documented her learning experiences with FreeBSD administration and open source software usage in a series of over 110 articles. Many readers praised and recommended the author’s informative tutorials. The Best of FreeBSD Basics book contains most of these articles – many updated from FreeBSD 4 and 5 to reflect the usage on FreeBSD 6 and 7. The Best of FreeBSD Basics provides practical advice for completing common tasks on FreeBSD and is a great way to get to know FreeBSD – and Unix in general. Darwin, DragonFly, Linux, Mac OS X, NetBSD, and OpenBSD fans will also find a lot of the book invaluable and useful. Covering a huge range of FreeBSD and open source topics, The Best of FreeBSD Basics includes step-by-step directions, things to watch out for, and hints for success. A sampling of the book’s topics include installing an X11 server and setting up an desktop environment, comparing common tasks with Linux, playing audio and video files, user administration, system startup, finding and using documentation, managing backups, networking basics, IPsec, setting up several servers, filtering spam, improving security, enabling firewalls, and a lot more.

 Richard Review give this book on my wishlist icon smile The Best of FreeBSD Basics

In mid-2004 I reviewed Dru Lavigne’s book BSD Hacks, which I really enjoyed. 3 1/2 years later I am pleased to say that Dru’s latest book, The Best of FreeBSD Basics (TBOFB), is another excellent resource for FreeBSD users. I really wish this book had been available in 2000 when I started using FreeBSD! If you are a beginner to intermediate FreeBSD user, you will find this book invaluable. If you are an advanced user, you may find a helpful tip or two as well.

[amazonify]159327145X:right[/amazonify]Along with Michael Lucas, Dru Lavigne is one of the best FreeBSD authors around. She is very clear and methodically explains material with examples. The format of the book also makes it easy to find relevant material. I will admit to not reading every word, but it’s not necessary with TBOFB. For example, I did not spend much time reading about Tcpdump basics. Because all of the commands are bolded, however, I was able to quickly locate syntax of interest to me. If I didn’t recognize something I started reading the discussion in depth.

I’d like to highlight some of my favorite parts of the book. If you are a Linux administrator, you will find the "FreeBSD for Linux admins" section in Ch 1 to be helpful. I hadn’t heard of bzcat (p 134) or showing control character mappings with stty -e (p 120). I didn’t know I could specify a ports tree INDEX file via URL when invoking pkg_version (p 169). I was glad to learn about Porteasy (p 335). I think beginning Unix users will find the material on manipulating the shell to be helpful too. Items like these are not earth-shattering, but they make the administrator’s life a little easier.

I have some recommendations for a second edition of TBOFB, which if addressed would result in a five star review. First, the layout of the pages makes some of the text difficult to read. The text is just too wide on the page. Readers have to peer into the binding of the book to see the end of text on the left side of the book. Second, the index could be more complete. I couldn’t find some tools I read about in the index. Third, it would be helpful to know what OS was used to demonstrate the examples. For example, Michael Lucas’ book Absolute FreeBSD, 2nd Ed, was written using 7-CURRENT. The back of TBOFB states that "many" of the articles were "updated from FreeBSD 4 and 5 to reflect the usage on FreeBSD 6 and 7." Some of the material is essentially timeless (e.g., shell usage) but other elements tend to be tied closely to FreeBSD version. IPSec configuration is one example; some of the syntax on p 356 is not used in FreeBSD 7.x, and new instructions have been added.

[amazonify]1593271514:right[/amazonify] Initially I was skeptical about reading TBOFB. After all, hadn’t I read most or all of Dru’s articles published at O’Reilly during the last several years? After reading TBOFB, I’m thankful for the review copy and I recommend all beginner and intermediate FreeBSD users read the book. TBOFB is a great complement to Lucas’ Absolute FreeBSD, 2nd Ed, and I expect the forthcoming Building a Server with FreeBSD 7 by Bryan Hong to fit nicely in this collection.

Wow, saving time for those books icon smile The Best of FreeBSD Basics

Unix

Downgrade FreeBSD ports

I used to use FreeBSD ports in all related server job. I don’t remember what ports that might behave strangely in my  mail server until I remember last portupgrade job. I upgrade dovecot to latest version. I think if I downgrade dovecot ports I’ll get my stable mail server back icon smile Downgrade FreeBSD ports

Here’s my steps to downgrade dovecot ports : ( similar way applicable to other FreeBSD ports)

1. Find out installed dovecot version :

mail2# pkg_info | grep dovecot

dovecot-1.0.13_1 Secure and compact IMAP and POP3 servers

2. Install portdowngrade (use ports) and execute portdowngrade after rehash.

I took freebsdanoncvs@anoncvs.FreeBSD.org as cvs server from here :

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/anoncvs.html

mail2# portdowngrade dovecot -s freebsdanoncvs@anoncvs.FreeBSD.org:/home/ncvs

portdowngrade 0.6 by Heiner Eichmann
Please note, that nothing is changed in the ports tree
unless it is explicitly permitted in step 6!
read more »

Linux PHP Unix

Reset Cacti Password, step by step

My other staff  ask me password for username admin. Yes, its administrator level in cacti.

After hardy trying to remember I gave up, I decide to reset it to other value but how?

I try to find out using database approach :

Here’s my steps :

1. Checking for cacti location and see db setting.

monitor# pwd

/usr/local/share/cacti/include

see setting dbnya.

monitor# cat db-settings.php

<?php
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";

$database_port = "3306";
?>

2. Enter database with information taken from db-settings.php information.

monitor# mysql -ucacti -p

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8343
Server version: 5.0.45 FreeBSD port: mysql-server-5.0.45_1

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

mysql> use cacti;

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> select * from auth_user;

ERROR 1146 (42S02): Table ‘cacti.auth_user’ doesn’t exist

Ups, my bad icon smile Reset Cacti Password, step by step

mysql> select * from user_auth;

+—-+———-+————-———————+——-+—————+————–——–+———–+———–+————–+—————-+————+—————+————–+———–—+————————+
| id | username | password                         | realm | full_name     | must_change_password | show_tree | show_list | show_preview | graph_settings | login_opts | policy_graphs | policy_trees | policy_hosts | policy_graph_templates |
+—-+———-+————-———————+——-+—————+————–——–+———–+———–+————–+—————-+————+—————+————–+———–—+————————+
|  1 | admin    | 7a40008b8368b684bec2286db1b073e2 |     0 | Administrator |                      | on        | on        | on           | on             |          1 |             1 |            1 |            1 |                      1 |
|  3 | monitor  | 719daab8833968dc805a345c58545ea6 |     0 | monitoring    |                      | on        | on        | on           | on             |          3 |             1 |            1 |            1 |                      1 |
|  7 | crash    | ac43724f16e9241d990427ab7c8f4228 |     0 | Nsun T        |                      | on        | on        | on           | on             |          3 |             1 |            1 |            1 |                      1 |
+—-+———-+————-———————+——-+—————+————–——–+———–+———–+————–+—————-+————+—————+————–+———–—+————————+
3 rows in set (0.00 sec)

mysql>exit

3. Generate new password with md5 utility.

monitor# md5 -s mypassword

MD5 ("mypassword") = 34819d7beeabb9260a5c854bc85b3e44

4. Update database value with new created password string.

monitor# mysql -ucacti -p

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8344
Server version: 5.0.45 FreeBSD port: mysql-server-5.0.45_1

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

mysql> update auth_user set password=’34819d7beeabb9260a5c854bc85b3e44′ where username=’admin’

done icon smile Reset Cacti Password, step by step