my note

 

Selasa, September 26, 2006

Install squid versi penguin :d

Install squid versi penguin :d
siapkan configurasi squid yg sudah di edit dan simpan di direktori /home/ atau tergantung anda
ini adalah contoh squid.conf dari seseorang yang mengajarkan saya tentang squid ini,
mudah-mudahan beliau ridho squid hasil configurenya dipublish..semoga aja [-o<



[root@penguin /]# cat /home/ghian/squid.conf.ghian
# squid.conf - Squid Object Cache configuration file
http_port 3128
cache_mem 10 MB
========================================
#acl blok url_regex -i "/etc/squid/DENIED"
#http_access deny blok
========================================
cache_swap_low 85
cache_swap_high 89
========================================
cache_dir diskd /cache 720 16 64 Q1=72 Q2=64
#cache_dir diskd /cache1 720 16 64 Q1=72 Q2=64
========================================
store_dir_select_algorithm round-robin
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF
========================================
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
========================================
logfile_rotate 1
pid_filename /var/run/squid.pid
hierarchy_stoplist ? cgi
acl QUERY urlpath_regex cgi \?
no_cache deny QUERY
========================================
# quick abort:
# always finish if less than 10k
# finish if more than 50%
# always abort if more tan 1024k
quick_abort_min 20 kb
quick_abort_pct 50%
quick_abort_max 1024 kb
========================================
emulate_httpd_log off
minimum_object_size 0 KB
maximum_object_size 20 MB
========================================
#read_timeout 30 minutes
#client_lifetime 3 hours
#pconn_timeout 15 seconds
#request_timeout 1 minute
shutdown_lifetime 10 seconds
positive_dns_ttl 53 seconds
negative_dns_ttl 29 seconds
========================================
ipcache_size 10240
ipcache_low 98
ipcache_high 99
========================================
cache_mgr admin@penguin.net
cache_effective_user squid
cache_effective_group squid
visible_hostname penguin.cartoonet.net
========================================
log_fqdn off
#ident_lookup off
memory_pools off
forwarded_for on
icp_hit_stale on
logfile_rotate 2
#referer_log /usr/local/squid/var/logs/referer.log
========================================
store_objects_per_bucket 10
store_avg_object_size 13 kb
netdb_high 10000
netdb_low 9900
netdb_ping_period 30 seconds
========================================
#log_icp_queries off
#test_reachability off
#query_icmp on
debug_options ALL,1 98,2
max_open_disk_fds 100
========================================
high_memory_warning 400 mb
high_response_time_warning 2000
high_page_fault_warning 2
========================================
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
========================================
strip_query_terms off
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_single_host off
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
========================================
#####
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl Purge method PURGE
acl localhost src 127.0.0.1/255.255.255.255
acl penguin src 192.168.1.0/255.255.255.0
acl master dst 192.168.0.99
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 81 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 1002 # qplex
acl CONNECT method CONNECT
========================================
acl blok url_regex -i xml.opera.com/update
acl blok url_regex -i autoupdate.windowsmedia.com/update/update.asp
acl blok url_regex -i cgi.sexlist.com/counter.cgi?
acl blok url_regex -i download.microsoft.com msnsrch.dlservice.microsoft.com
acl blok url_regex -i hosted.by.alphared.com
acl blok url_regex -i deploy.akamaitechnologies.com
acl blok url_regex -i graphics.adultfriendfinder.com
acl blok url_regex -i apps.kompas.com
acl blok url_regex -i avi$ mpg$
=========================================
http_access deny blok
http_access allow manager localhost
http_access allow Purge localhost
http_access allow penguin
http_access allow master
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
========================================
##SNMP CONF
snmp_port 3401
acl snmppublic snmp_community public
snmp_access allow snmppublic localhost
========================================
#start delay
acl browze url_regex -i "/etc/squid/video"
acl sibuk time 10:01-23:59
delay_pools 1
delay_class 1 2
delay_parameters 1 -1/-1 16000/6000
delay_access 1 allow browze sibuk all
#end delay
========================================
ie_refresh on

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i \.(class|css|js|gif|jpg)$ 100000 500% 99000000 ignore-reload override-expire
refresh_pattern -i \.(jpe|jpeg|png|bmp|tif)$ 100000 500% 99000000 ignore-reload override-expire
refresh_pattern -i \.(tiff|mov|avi|qt|mpeg)$ 100000 500% 99000000 ignore-reload override-expire
refresh_pattern -i \.(mpg|mpe|wav|au|mid)$ 100000 500% 99000000 ignore-reload override-expire
refresh_pattern -i \.(zip|gz|arj|lha|lzh)$ 100000 500% 99000000 ignore-reload override-expire
refresh_pattern -i \.(rar|tgz|tar|exe|bin)$ 100000 500% 99000000 ignore-reload override-expire
refresh_pattern -i \.(hqx|pdf|rtf|doc|swf)$ 100000 500% 99000000 ignore-reload override-expire
refresh_pattern -i \.(inc|cab|ad|txt|dll)$ 100000 500% 99000000 ignore-reload override-expire
#refresh_pattern -i . 43200 95% 86400
#refresh_pattern -i . 0 0% 4320
refresh_pattern -i . 180 20% 4320

# END configuration
=========================================
pindahkan file squid.conf ini /etc/squid/squid.conf [root@penguin /]# cp /home/ghian/squid.conf.ghian /etc/squid/squid.conf
cp: overwrite `/etc/squid/squid.conf'? yes
ubah kepemilikan direktori cache misal disimpan di /cache
[root@penguin /]# chown -R squid:root /cache/
lalu check dengan perintah ls -la
[root@penguin /]# ls -al /
total 172
drwxr-xr-x 24 root root 4096 Sep 26 15:27 .
drwxr-xr-x 24 root root 4096 Sep 26 15:27 ..
drwxrwxrwx 19 squid root 4096 Sep 26 19:58 cache <<---
menjalankan pertama kali squid yaitu dengan perintah
[root@penguin /]# squid -k parse
[root@penguin /]# squid -z
2006/09/26 20:45:13| Creating Swap Directories
[root@penguin /]# /etc/init.d/squid start
Starting squid: . [ OK ]
check squidnya jalan atau tidak dengan mengetik:
[root@penguin /]# netstat -pln | grep squid
tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN 9080/(squid)
udp 0 0 0.0.0.0:3130 0.0.0.0:* 9080/(squid)
udp 0 0 0.0.0.0:3401 0.0.0.0:* 9080/(squid)
udp 0 0 0.0.0.0:32980 0.0.0.0:* 9080/(squid)

berarti squid sudah jalan, sekrang tinggal test di browser dan check acces.log nya di :
[root@penguin /]# tail -f /var/log/squid/access.log
udah deh selsai..
setiap selsei edit squid ketik
[root@penguin /]# squid -k reconfigure
agar client langsung bisa browsing lewat squid maka di set transparen proxy pake iptables
[root@penguin /]# /etc/init.d/iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: nat filter [ OK ]
Unloading iptables modules: [ OK ]
[root@penguin /]# /sbin/iptables -t nat -A PREROUTING -i eth1 -p tcp -s 192.168.1.0/255.255.255.0 --dport 80 -j DNAT --to 192.168.1.1:3128
[root@penguin /]# /sbin/iptables-save
# Generated by iptables-save v1.3.0 on Tue Sep 26 20:59:49 2006
*nat
:OUTPUT ACCEPT [1:72]
:POSTROUTING ACCEPT [1:72]
:PREROUTING ACCEPT [4:629]
-A PREROUTING -s 192.168.1.0/255.255.255.0 -i eth1 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.1.1:3128
COMMIT
# Completed on Tue Sep 26 20:59:49 2006


hatur nuhun kanggo kang Deden

Label:

posted by Nature 3 at 10:19 PM | 0 comments

akhirnya bisa juga

hari ini akhirnya saya selsei juga iseng bikin LAN kecil-kecilan lagi. dari kemaren bingung belum bisa reply. ternyata masalahnya hanya satu..heheh belum di add routing di pc 0.1-nya untung dikasih taw kang yudi hehe tangkiw ya kang:
[root@192.168.0.1 ~]# ip r a 192.168.1.0/24 via 192.168.0.99
[root@192.168.0.1 ~]# ip r
202.51.233.64/28 dev eth0 proto kernel scope link src 202.51.233.78
192.168.1.0/24 via 192.168.0.99 dev eth1
192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.1
169.254.0.0/16 dev lo scope link
default via 202.51.233.65 dev eth0
di pc 192.168.1.1 akan seperti ini :
[root@192.168.1.1 ~]# ip r
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.99
169.254.0.0/16 dev eth1 scope link
default via 192.168.0.1 dev eth0
jadi cerita awalnya gini, seblumnya saya udah punya LAN I dengan ipaddr 192.168.0.0/24. tapi saya juga pengen punya LAN 2 lagi dengan ipaddr 192.168.1.0/24. jadi saya mesti install pc linux dengan settingan seperti yg ada di LAN I cuma mungkin mesti mengganti sedikit settingan di ip nya. perasaan dari kemaren udah selsei install pc LAN 2 persis dengan settingan yg ada di pc LAN I, cuma aneh nya kok masih belum bisa ping antar 192.168.1.1 dan 192.168.0.1. padahal semua atribut sudah di chek lhoo.. mulai dari
[root@penguin ~]# cat /etc/sysctl.conf
# Controls IP packet forwarding
net.ipv4.ip_forward = 1
[root@penguin ~]# cat /etc/resolv.conf
nameserver 202.51.232.114
nameserver 202.51.232.116
nameserver 202.155.0.10
[root@penguin ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=penguin
GATEWAY=192.168.0.1
[root@penguin ~]# /etc/init.d/iptables stop
[root@penguin ~]# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE -o eth0
[root@penguin ~]# /sbin/iptables-save > /etc/sysconfig/iptables
[root@penguin ~]# /etc/init.d/iptables restart
dah gitu di check jg kabel-kabelna.. eh masih saja lum bisa..fuihh dah capek deh
setelah di otak-atik eh ternyata di pc LAN I nya belum di add routing. heheh..sekrang dah bisa deh.
hatur nuhun ah kanggo kang yudi.

Label:

posted by Nature 3 at 5:46 PM | 0 comments

Sabtu, September 23, 2006

setting router warnet

Akhirnya jadi juga tutorial setting router warnet untuk linux.
Saya menulis ini buat temen2 yang minta untuk di buatin tutorial untuk setting router warnet,dimana sebelumnya mereka memakai router windows dan mau migrasi ke linux.

 
                           |eth0
                           |
                       |-------|
                       |  MGW  |
                       |---|---|
                           |
                           |eth1
                           |
                           |
      |--------------------hub----------------------|
      |                    |                      |
      |                    |                      |
      |                    |                      |
 |---------|          |---------|            |---------|
 |Client 01|          |Client 02|            |Client 03|
 |---------|          |---------|            |---------|
 
Pertama yang harus di lakukan adalah mensetting mgw(main gateway)
supaya bisa connect ke internet
Sebelum Mensetting :
1.Minta IP public ke ISP lengkap dengan netmask,broadcast dan dns nya
misalnya :
RANGE : 202.159.121.0/29
IP : 202.159.121.2
GATEWAY : 202.159.121.1
Nemast : 255.255.255.248
broadcast : 202.159.121.7
DNS1 : 202.159.0.10
DNS2 : 202.159.0.20
berarti kita mendapatkan ip 5 buah dari 202.159.121.2 - 202.159.121.6
2.Menentukan IP local yang akan kita gunakan buat client
Setting IP MGW :
1.[root@mgw cachak]$ vi /etc/sysconfig/network
lalu isi dengan :
NETWORKING=yes
HOSTNAME=mgw.domain.com
GATEWAY=202.159.121.1
lalu simpen dengan menekan :wq
2.Menconfigurasi IP eth0(default) 
[root@mgw root]$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
lalu isi dengan :
DEVICE=eth0
BOOTPROTO=static
IPADDR=202.159.121.2
BROADCAST=202.159.121.7
NETMASK=255.255.255.249
ONBOOT=yes
USERCTL=no
lalu simpen dengan menekan :wq
3.Setting dns resolv
 [root@mgw root]$ vi /etc/resolv.conf
lalu isi dengan nameserver dari isp kita tadi :
nameserver 202.159.0.10
nameserver 202.159.0.20
lalu simpen dengan menekan :wq
4.Setting ip_forwarding
[root@mgw cachak]$ vi /etc/sysctl.conf
rubah net.ipv4.ip_forward = 0 menjadi net.ipv4.ip_forward = 1
atau kalau gak ada net.ipv4.ip_forward = 0 tambahin net.ipv4.ip_forward = 1
simpen dengan menekan :wq
5.restart network
[root@mgw cachak]$ /etc/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Disabling IPv4 packet forwarding: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
 [root@www root]#chkconfig --level 2345 network on
6.testing dengan ngeping ke default gateway 202.159.121.1
 [root@mgw cachak]$ ping 202.159.121.1
PING
202.159.121.1 (202.159.121.1) 56(84) bytes of data.
64 bytes from 202.159.121.1: icmp_seq=1 ttl=63 time=0.356 ms
64 bytes from 202.159.121.1: icmp_seq=2 ttl=63 time=0.269 ms
64 bytes from 202.159.121.1: icmp_seq=3 ttl=63 time=0.267 ms
64 bytes from 202.159.121.1: icmp_seq=4 ttl=63 time=0.268 ms
 --- 202.159.121.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.267/0.290/0.356/0.038 ms
 7.testing untuk ngeping google.com untuk ngecek dns nya
kalau muncul :
PING
google.com (216.239.39.99) 56(84) bytes of data.
berarti dns kita untuk mgw dah bekerja, tapi kalau muncul :
ping: unknown host google.com
berarti dns yang kita isikan di /etc/resolv.conf masih salah,
silahkan cek lagi ke ISP nya
:)
nah bereskan sudah setting IP untuk mgw nya :)
supaya mgw ini bisa sekaligus di gunakan sebagai ns server
oleh client maka harus di install daemon bind atau
daemon nameserver yang lain
ataukalau sudah ada tinggal idupin Bind nya
[root@www root]# /etc/init.d/named restart
Stopping named: [ OK ]
Starting named: [ OK ]
[root@www root]#chkconfig --level 2345 named on
[root@www root]#
misalnya ip ke client adalah :
192.168.0.1/24
IP : 192.168.0.1
netmask : 255.255.255.0
broadcast : 192.168.0.255
RANGE IP CLIENT : 192.168.0.2-192.168.0.254
 Setting ip untuk eth1 (yang ke client)
1.memberi IP 192.168.0.1 di eth1
[root@mgw cachak]$ vi /etc/sysconfig/network-scripts/ifcfg-eth1
lalu isi dengan :
DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.0.1
NETMASK=255.255.255.0
BROADCAST=192.168.0.255
ONBOOT=yes
USERCTL=no
lalu simpen dengan menekan :wq
2.Restart networknya
[root@mgw root]$ /etc/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down interface eth1: [ OK ]
Shutting down loopback interface: [ OK ]
Disabling IPv4 packet forwarding: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]
3.Testing dengan cara ping ip eth1
[root@mgw cachak]$ ping 192.168.0.1

PING
192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=63 time=0.356 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=63 time=0.269 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=63 time=0.267 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=63 time=0.268 ms
--- 192.168.0.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.267/0.290/0.356/0.038 ms
 Tinggal Setting IP computer client dengan ketentuan di bawah ini :
IP             : 192.168.0.2 - 192.168.0.254
GATEWAY : 192.168.0.1
NETMASK : 255.255.255.0
BROADCAST : 192.168.0.255
NAMESERVER : 192.168.0.1
misal :
 Client01
===============================
IP             : 192.168.0.2
GATEWAY : 192.168.0.1
NETMASK : 255.255.255.0
BROADCAST : 192.168.0.255
NAMESERVER : 192.168.0.1
 Client02
===============================
IP             : 192.168.0.3
GATEWAY : 192.168.0.1
NETMASK : 255.255.255.0
BROADCAST : 192.168.0.255
NAMESERVER : 192.168.0.1
dan seterusnya sesuai banyaknya client,yang berubah hanya IP
untuk client windows maka setting IP
di bagian Start Menu/Setting/Control Panel/Network
setelah di setting ip client, maka coba ping ke 192.168.0.1
dari client,kalau berhasil berarti client dan MGW nya sudah tersambung.
Setting MGW supaya client bisa internat dengan menggunakan NAT
1.Matikan iptablesnya
[root@mgw root]# /etc/init.d/iptables stop

Flushing
all chains: [ OK ]
Removing user defined chains: [ OK ]
Resetting built-in chains to the default ACCEPT policy: [ OK ]
2.Tambahkan iptables untuk Source NAt sesuai dengan ip di eth0
[root@mgw root]# /sbin/iptables -t nat -A POSTROUTING
-o eth0 -s 192.168.0.0/24 -j SNAT --to-source 202.159.121.2
[root@mgw root]# /sbin/iptables-save > /etc/sysconfig/iptables
[root@mgw root]# /etc/init.d/iptables restart

Flushing
all current rules and user defined chains: [ OK ]
Clearing all current rules and user defined chains: [ OK ]
Applying iptables firewall rules: [ OK ]
[root@mgw root]# iptables-save
SNAT sudah,SNAT disini standar sekali dan gak ada proteksi
untuk mengetest nya kita browser di client lalau buka google.com,
kalau jalan berati kita sudah berhasil
:)

di kutip dari : http://sahir.dozer.or.id/wp/2005/07/11/setting-router-warnet/

Label:

posted by Nature 3 at 4:46 PM | 0 comments

install squid versi bang duken

install proxy cara cepat ala bang  duken :p~~
donwload versi terbaru squid di http://squid-cache.org
% wget http://www.squid-cache.org/Versions/v2/2.5/squid-2.5.STABLE5.tar.gz
% tar zxf squid-2.5.STABLE5.tar.gz
% cd squid-2.5.STABLE5
% wget http://person.olami.net.id/~duken/old/stuff/squid.sh
% chmod +x squid.sh
% ./squid.sh
% make
% make all
% make install (as root)
% cd /squid/etc
% mv squid.conf squid.conf.asli
% wget http://person.olami.net.id/~duken/old/stuff/squid.conf
edit squid.confnya sesuaikan dengan konfigurasi network anda

buat user dan groups yg akan menjalankan squid

% useradd squid
% groupadd squid
ubah permission dr directori cache dan direktori dimana anda melatakkan access.log
untuk mengetahui tempat access.log tersebut gunakan perintah berikut:
% grep access.log squid.conf
cache_access_log /home/squid/access.log

dr output grep di atas access.log terdapat pada /home/squid/access.log
maka ubahlah pemiliknya menjadi squid
% chown -R squid:squid /home/squid
dan untuk di rektori chace misalkan anda buatkan di /var/cache
maka lakukan perintah ini:
% chown -R squid:squid /var/cache

menjalankan pertama kali squid
% /squid/sbin/squid -z
% /squid/sbin/squid -sYD

kalo misalkan anda satu saat mengupdate isi squid.conf maka jgn lupa untuk melakukan perintah ini :
% /squid/sbin/squid -k reconfigure

Rekomendasi:
http://person.olami.net.id/~duken/tutorial/squid.txt
http://efnet.linux.or.id/docs/instalasi-squid.html
http://squid-docs.sourceforge.net/

pertanyaan ?? silahkan email ke me[at]duken.biz (jangan lupa [at] di ganti dengan @)


Label:

posted by Nature 3 at 2:29 PM | 0 comments

Cara mengecheck port yang aktif

Buat ngecek port yang aktif, misal di komputer server / gateway kita bisa menggunakan aplikasi iptraf. aplikasi ini biasanya sudah ada di semua distro (aplikasi standard). Aplikasi ini default hanya bisa dijalankan oleh root. dari console jalankan #iptraf, pilih Statistical breakdowns.., dan pilih By TCP/UDP Port, selanjutnya pilih kartu jaringan yang ingin kita pantau, dalam screenshot dibawah yang saya pantau adalah eth0 yang langsung terhubung ke internet. (lihat gambar)

btw secara default port yang dipantau hanyalah port dari 1 - 1023 saja. Nah untuk port port diatas itu kita harus konfigurasi dulu.

IPTraf also includes a facility that generates statistics on TCP and UDP traffic. This facility displays counts of all TCP and UDP packets with source or destination ports numbered less than 1024. Ports 1 to 1023 are reserved for the TCP/IP application protocols (well-known ports).

Cara konfigurasinya dari gambar nomor 1 kita pilih Configure .. , sehingga tampil tampilan berikut ini:

Pilih yang Additional ports.. lalu masukkan range dari 1 - 10000 misalnya untuk memonitor port antara 1 - 10000. Untuk memudahkan kita mengetahui service yang berjalan di port tersebut (nama service pada umumnya) aktifkan status TCP/UDP service names menjadi ON.

Untuk selanjutnya apabila kita ingin menjalankan iptraf dari konsol cukup jalankan perintah :

# iptraf -s eth0

artinya jalankan program iptraf dengan tampilan monitoring pada port yang aktif pada kartu jaringan eth0 . buat referensi bahasa inggrisnya bisa dibaca di: IPTraf User Manual

di kutip dari : http://linux.gue.or.id/

Label:

posted by Nature 3 at 1:19 PM | 0 comments

Instalasi linux Sebagai Internet Sharing Conection

Ketertarikan untuk mencoba linux, timbul saat microsoft mengeparkan sweeping.Dalam artikel ini saya akan mencoba menjelaskan bagaimana cara menginstall Linux agar bisa di gunakan sebagai Server Internet Sharing untuk keperluan warnet.Semoga artikel ini bermanfaat bagi temen-temen yang membacanya. Amien

Kebutuhan Dasar:

# Distro Linux Fedora Core 2 .

# Komputer dengan 2 ethernet

# Iptraf

# Iftop

# cbq

Instalasi & konfigurasi

Untuk tahap instalasi dalam hal ini saya asumsikan sudah beres terinstall pada sebuah pc, pastikan 2 ethernet sudah terdeteksi. Kalau belum kedetek coba jalanin service kudzu.tapi untuk distro linux biasanya sudah langsung bisa mendeteksi ethernet.

# konfigurasi Ethernet

untuk konfigurasi Ethernet dan pemberian ip edit file di /etc/sysconfig/network-script/ifcfg-eth0 untuk ip address dari ISP :

IPADDR : 202.51.233.65

NETWORK : 202.51.233.64

BROADCAST : 202.51.233.79

[root@penguin root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

# D-Link System Inc|RTL8139 Ethernet

DEVICE=eth0

BOOTPROTO=static

BROADCAST=202.51.233.79

HWADDR=00:11:95:22:38:AF

IPADDR=202.51.233.78

NETMASK=255.255.255.240

NETWORK=202.51.233.64

ONBOOT=yes

TYPE=Ethernet

GATEWAY=202.51.233.65 -->>[ menuju ke ip address router milik isp ]

lalu edit juga eth1-nya,

[root@penguin root]# vi /etc/sysconfig/network-scripts/ifcfg-eth1

# D-Link System Inc|RTL8139 Ethernet

DEVICE=eth1

ONBOOT=yes

BOOTPROTO=static

BROADCAST=192.168.0.255

HWADDR=00:0D:88:41:9F:CC

IPADDR=192.168.0.1

NETMASK=255.255.255.0

GATEWAY=202.51.233.78 -->> [ menuju ke ip address eth0 ]

NETWORK=192.168.0.0

ONBOOT=yes

TYPE=Ethernet

setelah itu restart Ethernetnya,

[root@penguin root]# service network restart

Agar paket dari jaringan client dapat berjalan ke jaringan di luarnya melalui gateway, maka harus diterapkan forwarding.
Edit file /etc/sysctl.conf untuk mengeset forwarding di Linux kita. Contoh:

# Edit file forwarding di file /etc/sysctl.conf

[root@penguin root]# vi /etc/sysctl.conf

# Kernel sysctl configuration file for Red Hat Linux

#

# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and

# sysctl.conf(5) for more details.

# Controls IP packet forwarding

net.ipv4.ip_forward = 1 --->> di ubah yg asalnya 0 menjadi 1

# Controls source route verification

net.ipv4.conf.default.rp_filter = 1

# Controls the System Request debugging functionality of the kernel

kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.

# Useful for debugging multi-threaded applications.

kernel.core_uses_pid = 1

# Internet hanya mengenali ip publik, lalu bagaimana biar bisa mengenali ip lokal atau ip privat, disinilah fungsinya masquerading dengan firewall. Di artikel ini sudah tersedia scripts firewall.conf, tapi sebelum itu. Daftarkan dulu ip publik di folder /etc/rc.local atau di folder /etc/rc.d/rc.local

[root@penguin root]# vi /etc/rc.d/rc.local

#!/bin/sh

#

# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

/sbin/ifconfig eth0:1 202.51.233.66 netmask 255.255.255.240

/sbin/ifconfig eth0:2 202.51.233.67 netmask 255.255.255.240

/sbin/ifconfig eth0:3 202.51.233.68 netmask 255.255.255.240

/sbin/ifconfig eth0:4 202.51.233.69 netmask 255.255.255.240

/sbin/ifconfig eth0:5 202.51.233.70 netmask 255.255.255.240

/sbin/ifconfig eth0:6 202.51.233.71 netmask 255.255.255.240

/sbin/ifconfig eth0:7 202.51.233.72 netmask 255.255.255.240

/sbin/ifconfig eth0:8 202.51.233.73 netmask 255.255.255.240

/sbin/ifconfig eth0:9 202.51.233.74 netmask 255.255.255.240

/sbin/firewall.conf

/sbin/cbq.init-v0.7.3 start

echo"1">/proc/sys/net/ipv4/ip_forward

echo"1">/proc/sys/net/ipv4/tcp_syncookies

/usr/local/sbin/oidentd -d -u ident -g ident -f -m

tambahkan scripts yang bertulisan miring semua ke folder /etc/rc.local tersebut.

Setelah itu restart lagi networknya : [root@penguin root]# service network restart

# Masukan scripts firewall.conf ke dir : /sbin

[root@penguin root]# vi /sbin/firewall.conf

masukan scripts firewall.conf

#!/bin/sh

RULE=/sbin/iptables

PROXY=192.168.0.1:3128

$RULE -F INPUT

$RULE -F OUTPUT

$RULE -F FORWARD

$RULE -X

$RULE -t mangle -F

$RULE -t nat -F

$RULE -t mangle -X

$RULE -t nat -X

# B L O C K I N G F U C K I N G S P O O F

for f in /proc/sys/net/ipv4/conf/*/rp_filter; do

echo 1 > $f

done

# B L O C K I N G F U C K I N G S I T E S

$RULE -A FORWARD -d 66.94.230.47 -j DROP

# B L O C K I N G F U C K I N G P O R T

$RULE -A INPUT -i eth0 -p tcp --dport 3128 -j DROP

$RULE -A FORWARD -i eth1 -p tcp --sport 137:139 -j DROP

$RULE -A FORWARD -i eth0 -p tcp --sport 1105:1110 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 31337 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 12345:12346 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 20034 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 876 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 5742 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 40421 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 30303 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 6028 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 6888 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 61540 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 5100 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 5000 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 41031:41900 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 32760:32770 -j DROP

$RULE -A FORWARD -i eth1 -p tcp --sport 32760:32770 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 3306 -j DROP

$RULE -A FORWARD -i eth1 -p udp --sport 113 -j ACCEPT

$RULE -A FORWARD -i eth1 -p udp --sport 6588 -j ACCEPT

# N A T D A E M O N F O R I N T R A N E T

$RULE -t mangle -A FORWARD -p tcp -j TOS --set-tos 8

# S N A T C O N F I G U R A T I O N S

$RULE -t nat -A POSTROUTING -s 192.168.0.3 -j SNAT --to 202.51.233.72

$RULE -t nat -A POSTROUTING -s 192.168.0.4 -j SNAT --to 202.51.233.66

$RULE -t nat -A POSTROUTING -s 192.168.0.5 -j SNAT --to 202.51.233.66

$RULE -t nat -A POSTROUTING -s 192.168.0.6 -j SNAT --to 202.51.233.66

$RULE -t nat -A POSTROUTING -s 192.168.0.7 -j SNAT --to 202.51.233.67

$RULE -t nat -A POSTROUTING -s 192.168.0.8 -j SNAT --to 202.51.233.67

$RULE -t nat -A POSTROUTING -s 192.168.0.9 -j SNAT --to 202.51.233.67

$RULE -t nat -A POSTROUTING -s 192.168.0.10 -j SNAT --to 202.51.233.68

$RULE -t nat -A POSTROUTING -s 192.168.0.11 -j SNAT --to 202.51.233.68

$RULE -t nat -A POSTROUTING -s 192.168.0.12 -j SNAT --to 202.51.233.68

$RULE -t nat -A POSTROUTING -s 192.168.0.13 -j SNAT --to 202.51.233.69

$RULE -t nat -A POSTROUTING -s 192.168.0.14 -j SNAT --to 202.51.233.69

$RULE -t nat -A POSTROUTING -s 192.168.0.15 -j SNAT --to 202.51.233.69

$RULE -t nat -A POSTROUTING -s 192.168.0.16 -j SNAT --to 202.51.233.70

$RULE -t nat -A POSTROUTING -s 192.168.0.17 -j SNAT --to 202.51.233.70

$RULE -t nat -A POSTROUTING -s 192.168.0.18 -j SNAT --to 202.51.233.70

$RULE -t nat -A POSTROUTING -s 192.168.0.19 -j SNAT --to 202.51.233.71

$RULE -t nat -A POSTROUTING -s 192.168.0.20 -j SNAT --to 202.51.233.71

$RULE -t nat -A POSTROUTING -s 192.168.0.21 -j SNAT --to 202.51.233.71

$RULE -t nat -A POSTROUTING -s 192.168.0.22 -j SNAT --to 202.51.233.72

$RULE -t nat -A POSTROUTING -s 192.168.0.23 -j SNAT --to 202.51.233.72

$RULE -t nat -A POSTROUTING -s 192.168.0.24 -j SNAT --to 202.51.233.73

$RULE -t nat -A POSTROUTING -s 192.168.0.25 -j SNAT --to 202.51.233.73

$RULE -t nat -A POSTROUTING -s 192.168.0.26 -j SNAT --to 202.51.233.73

$RULE -t nat -A POSTROUTING -s 192.168.0.27 -j SNAT --to 202.51.233.74

$RULE -t nat -A POSTROUTING -s 192.168.0.28 -j SNAT --to 202.51.233.74

$RULE -t nat -A POSTROUTING -s 192.168.0.29 -j SNAT --to 202.51.233.74

$RULE -t nat -A POSTROUTING -s 192.168.0.30 -j SNAT --to 202.51.233.74

#Transparant Proxy

$RULE -t nat -A PREROUTING -i eth1 -p tcp -d 0/0 --dport 80 -j DNAT --to 192.168.0.1:3128

$RULE -t nat -A PREROUTING -i eth1 -p tcp -d 0/0 --dport 8080 -j DNAT --to 192.168.0.1:3128

$RULE -t nat -A PREROUTING -i eth1 -p tcp -d 0/0 --dport 3128 -j DNAT --to 192.168.0.1:3128

lalu save ..

dan ubah permision untuk file /sbin/firewall.conf

[root@penguin root]# chmod 700 /sbin/firewall.conf
[root@penguin root]# iptables-save

setelah itu check iptablesnya

[root@penguin /]# iptables -t nat -nvL

Chain PREROUTING (policy ACCEPT 1281 packets, 1542K bytes)

pkts bytes target prot opt in out source destination

Chain POSTROUTING (policy ACCEPT 11 packets, 826 bytes)

pkts bytes target prot opt in out source destination

0 0 SNAT all -- * * 192.168.0.3 0.0.0.0/0 to:202.51.233.72

0 0 SNAT all -- * * 192.168.0.4 0.0.0.0/0 to:202.51.233.66

0 0 SNAT all -- * * 192.168.0.5 0.0.0.0/0 to:202.51.233.66

0 0 SNAT all -- * * 192.168.0.6 0.0.0.0/0 to:202.51.233.66

0 0 SNAT all -- * * 192.168.0.7 0.0.0.0/0 to:202.51.233.67

0 0 SNAT all -- * * 192.168.0.8 0.0.0.0/0 to:202.51.233.67

0 0 SNAT all -- * * 192.168.0.9 0.0.0.0/0 to:202.51.233.67

0 0 SNAT all -- * * 192.168.0.10 0.0.0.0/0 to:202.51.233.68

0 0 SNAT all -- * * 192.168.0.11 0.0.0.0/0 to:202.51.233.68

0 0 SNAT all -- * * 192.168.0.12 0.0.0.0/0 to:202.51.233.68

0 0 SNAT all -- * * 192.168.0.13 0.0.0.0/0 to:202.51.233.69

0 0 SNAT all -- * * 192.168.0.14 0.0.0.0/0 to:202.51.233.69

0 0 SNAT all -- * * 192.168.0.15 0.0.0.0/0 to:202.51.233.69

0 0 SNAT all -- * * 192.168.0.16 0.0.0.0/0 to:202.51.233.74

0 0 SNAT all -- * * 192.168.0.17 0.0.0.0/0 to:202.51.233.74

0 0 SNAT all -- * * 192.168.0.18 0.0.0.0/0 to:202.51.233.74

0 0 SNAT all -- * * 192.168.0.19 0.0.0.0/0 to:202.51.233.71

0 0 SNAT all -- * * 192.168.0.20 0.0.0.0/0 to:202.51.233.71

0 0 SNAT all -- * * 192.168.0.21 0.0.0.0/0 to:202.51.233.71

0 0 SNAT all -- * * 192.168.0.22 0.0.0.0/0 to:202.51.233.72

0 0 SNAT all -- * * 192.168.0.23 0.0.0.0/0 to:202.51.233.72

0 0 SNAT all -- * * 192.168.0.24 0.0.0.0/0 to:202.51.233.73

0 0 SNAT all -- * * 192.168.0.25 0.0.0.0/0 to:202.51.233.73

0 0 SNAT all -- * * 192.168.0.26 0.0.0.0/0 to:202.51.233.73

0 0 SNAT all -- * * 192.168.0.27 0.0.0.0/0 to:202.51.233.74

0 0 SNAT all -- * * 192.168.0.28 0.0.0.0/0 to:202.51.233.74

0 0 SNAT all -- * * 192.168.0.29 0.0.0.0/0 to:202.51.233.74

0 0 SNAT all -- * * 192.168.0.30 0.0.0.0/0 to:202.51.233.74

Chain OUTPUT (policy ACCEPT 11 packets, 826 bytes)

pkts bytes target prot opt in out source destination

test routing dulu ke ip privat dan ke ip public apakah sudah bisa saling reply, klu sudah bisa berarti udah hampir selesai.

# Instalasi iptraf atau tools jaringan

download iptraf versi terbaru waktu artikel ini saya buat iptraf baru nyampe versi iptraf-3.0.0.tar.gz

simpan di direktori /usr/local/ lalu masuk ke directori tersebut dengan cd /usr/local/ dan install software tersebut dengan menjalankan perintah berikut ini :

tar xvzf iptraf-3.0.0.tar.gz

cd iptraf-3.0.0

./setup ATAU ketik /usr/local/iptraf-3.0.0/INSTALL

Pada saat instalasi selesai, hasil dari binary iptraf akan berada di /usr/local/bin dan harus dejalankan oleh root.

Menjalankan IPTraf

Buka konsol berukuran 80 kolom x 24 baris (satu-satunya ukuran di mana IPTraf dapat tampil). Kemudian, su ke root (hanya root yang dapat menjalankan IPTraf) dan jalankan perintah iptraf. Anda akan mendapatkan salam dari layar yang menampilkan informasi produk, termasuk versi, nama pembuat, informasi hak cipta, dan lisensi. Tekan tombol apa saja untuk melanjutkan. Layar berikutnya, (Gambar A) akan menampilkan beberapa pilihan.

Dari menu ini, scroll ke Configure, atau tekan tombol O (di-highlight dengan warna biru). Pada menu Configure, Anda dapat mengatur beberapa pilihan mulai dari Reverse DNS Lookup sampai ke Closed/Idle Persist.

Misalnya kita akan mengeset Logging ke On. Untuk melakukan ini, scroll ke bawah menggunakan anak panah ke entry Logging dan tekan [Enter]. Anda akan melihat entry Logging di sebelah kanan berubah dari Off menjadi On.

Dengan Loggin diaktifkan, tekan tombol x atau scroll ke Exit dan tekan [Enter], tekan tombol m atau scroll ke IP Traffic Monitor, dan tekan [Enter] untuk membuka menu tersebut. Selanjutnya, pilih interface eth0, isikan nama logfile atau biarkan default /var/log/iptraf/ip_traffic-1.log dan tekan [Enter] kembali. Anda akan melihat trafik jaringan yang berjalan terlalu cepat. Untung saja, Anda mengaktifkan Logging. Sekarang jika Anda membuka text editor favorit Anda, untuk melihat file log tersebut, Anda akan melihat sebuah daftar.

Jika Anda memperhatikan setiap entry, Anda akan melihat bahwa setiap entry tersebut berisi hal berikut :

* Timestamp : bulan, tanggal, waktu, tahun

* Protocol : ARP, OSPF, TCP, UDP, dan lain-lain

* Interface : eth0, eth1, localhost, dan lain-lain<

* Ukuran Paket dalam byte

Alamat : Alamat yang berada setelah keyword for merupakan alamat tujuan, dan yang berada setelah keyword from adalah alamat asal. Alamat tersebut dapat berupa alamat IP atau MAC.

# instalasi iftop = display bandwidth usage on an interface

download iftop versi terbaru saat artikel ini saya buat iftop yang saya pake adalah


iftop-0.16-0.fdr.3.rh90.i386.rpm

Install iftop dengan perintah :

[root@penguin root]# rpm -ivh iftop-0.16-0.fdr.3.rh90.i386.rpm

jalankan iftop :

[root@penguin root]# iftop -i eth1 atau iftop -i eth0 atau iftop saja

# Instalasi cbq

donwload cbq versi terbaru, saat saya donlot adalah versi cbq.init-v0.7.3, lalu pindahkan ke directori /sbin.

Ubah ke permision [root@penguin root] #chmod 755 cbq.init-v0.7.3

buat configuration file pada /etc/sysconfig/cbq:

[root@penguin root]#mkdir /etc/sysconfig/cbq

[root@penguin root]# touch /etc/sysconfig/cbq/cbq-0002.fast

[root@penguin root]# vi /etc/sysconfig/cbq/cbq-0002.fast

masukan scripst cbq-0002.fast

DEVICE=eth1,100Mbit,10Mbit

RATE=160Kbit

WEIGHT=16Kbit

PRIO=1

PEAK=160Kbit

LEAF=tbf

BOUNDED=yes

ISOLATED=no

RULE=192.168.0.99 <ß terserah anda mu ngasih ip berapa

RULE=:4012,192.168.0.0/16

[root@penguin root]# /sbin/cbq.init-v0.7.3 compile

[root@penguin root]# /sbin/cbq.init-v0.7.3 restart

[root@penguin root]# touch /etc/sysconfig/cbq/cbq-0003.cl-01

[root@penguin root]# vi /etc/sysconfig/cbq/cbq-0003.cl-01

masukan scripst cbq-0003.cl-01

DEVICE=eth1,100Mbit,10Mbit

RATE=20Kbit

WEIGHT=3Kbit

PRIO=2

PEAK=30Kbit

LEAF=sfq

BOUNDED=no

ISOLATED=yes

RULE=192.168.0.4

[root@penguin root]# /sbin/cbq.init-v0.7.3 compile

[root@penguin root]# /sbin/cbq.init-v0.7.3 restart

dan seterusnya sampai habis client yg di butuhkan

jangan lupa tambahin script pada rc.local, jadi pas server restart, langsung jalan

/sbin/cbq.init-v0.7.3 start

KET:

DEVICE=eth1,100Mbit,10Mbit <-- nujuk ke eth1 yg ke lan cartoon

RATE=20Kbit <-- rata2 download

WEIGHT=3Kbit <-- paling rendah

PRIO=2 <-- prirotas kedua

PEAK=30Kbit <-- paling tinggi bisa segini

LEAF=sfq

untuk mengecek list di module

[root@penguin root]# lsmod

Module Size Used by

cls_route 4736 0

cls_u32 5508 1

cls_fw 3200 0

sch_prio 3456 0

sch_sfq 4352 2

sch_tbf 4224 0

sch_cbq 13184 1 <<-- cbqnya dah jalan

[root@penguin root]# ls -al /etc/sysconfig/cbq/

total 96

drwxr-xr-x 2 root root 4096 Apr 11 08:03 .

drwxr-xr-x 8 root root 4096 Apr 10 09:24 ..

-rw-r--r-- 1 root root 151 Apr 11 08:01 cbq-0002.fast

-rw-r--r-- 1 root root 121 Apr 10 09:29 cbq-0003.cl-01

-rw-r--r-- 1 root root 121 Apr 10 09:29 cbq-0003.cl-02

-rw-r--r-- 1 root root 121 Apr 10 09:57 cbq-0003.cl-03

-rw-r--r-- 1 root root 121 Apr 10 09:59 cbq-0003.cl-04

-rw-r--r-- 1 root root 121 Apr 10 09:59 cbq-0003.cl-05

-rw-r--r-- 1 root root 121 Apr 10 10:00 cbq-0003.cl-06

-rw-r--r-- 1 root root 122 Apr 10 10:00 cbq-0003.cl-07

-rw-r--r-- 1 root root 122 Apr 10 10:01 cbq-0003.cl-08

-rw-r--r-- 1 root root 122 Apr 10 10:01 cbq-0003.cl-09

-rw-r--r-- 1 root root 122 Apr 10 10:02 cbq-0003.cl-10

-rw-r--r-- 1 root root 122 Apr 10 10:02 cbq-0003.cl-11

-rw-r--r-- 1 root root 122 Apr 10 10:02 cbq-0003.cl-12

-rw-r--r-- 1 root root 122 Apr 10 10:03 cbq-0003.cl-13

-rw-r--r-- 1 root root 122 Apr 10 10:03 cbq-0003.cl-14

-rw-r--r-- 1 root root 122 Apr 10 10:04 cbq-0003.cl-15

-rw-r--r-- 1 root root 122 Apr 10 10:04 cbq-0003.cl-16

-rw-r--r-- 1 root root 122 Apr 10 10:05 cbq-0003.cl-17

-rw-r--r-- 1 root root 122 Apr 10 10:05 cbq-0003.cl-18

-rw-r--r-- 1 root root 122 Apr 10 10:05 cbq-0003.cl-19

-rw-r--r-- 1 root root 122 Apr 10 10:06 cbq-0003.cl-20

-rw-r--r-- 1 root root 247 Apr 11 08:03 cbq-0004.scan

Beberapa hal yang perlu anda pastikan dalam mengamankan account root adalah:
1.jangan sekali kali login sebagai account root,jika tidak sangat penting atau perlu.
2.Jika terpaksa ingin mengunakan root,loginla sebagai user biasa kemudian masuk ke su (substitute user).
3.Jangan sekali kali menggunakan seperangkat utilitas,seperti rlogin/rsh/rexec (disebut utilitas r)sebagai root.Mereka menjadi banyak sasaran serangan dan sangat berbahaya bila di jalankan sebagai root.
4.Jangan membuat file .rhosts untuk root
5.jangan pernah menggunakan ".",yang berarti direktory saat ini dalam peryertaan path.
6.Batasi penggunaan konsol untuk login sebagai root untuk membatasinya,bisa ilakukan editing pada /etc/securetty example:

[root@penguin]# vi /etc/securetty
tty1
tty2
tty3
tty4
tty5
tty6
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6

Batasi penggunaan root hanya pada konsol 1 dan 2 dengan cara menghapus tty3 dan tty4.
Batasi waktu penggunan account root (time out),hal ini berguna jika pada suatu saat anda lupa melakukan log out dari account root.Cara mengedit time out, edit file /root/.bashrc .tambah variabel sbb;

[root@penguin]# vi /root/.bashrc
# .bashrc

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
ENV=$HOME/.bashrc
USERNAME="root"
export USERNAME ENV PATH
HISTFILESIZE=100
HISTSIZE=50
TMOUT=1200

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# enable programmable completion features
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

Variabel TMOUT berfungsi sebagai penghitung waktu pada saat user root sedang tidak aktif lagi.Lama waktunya dalam satuan detik Jadi jika anda logout selama 20 menit.Anda bisa menetapkan dengan perhitungan 60 detik x 20 menit=1200,HISTSIZE fungsinya untuk membatasi history pengetikan sampai pada 50 baris.sedang HISTFILESIZE berfungsi untuk membatasi ukuran file .bash_history (neh om ichan,yang bikin komp om lelet)sampai dengan 100 byte saja selanjutnya akan dihapus.Dengan demikian,akan mengecoh cracker untuk melakukan pengintipan di .bash_history.Anda juga bisa memasang di /etc/profile untuk seluruh user.
Untuk melihat efek sampingnye (kyk minum obat aja),logout dahulu kemudian login lagi sebagai user root(su).Untuk mengamankan account root edit file /root/.bashrc dan isi variabel;

cat /dev/null > /root/.bash_history


Fungsi dari penambahan variabel diatas adalah akan secara otomatis mengosongkan file .bash_history pada saat user root melakukan login.variabel ini juga bisa anda terapkan pada file .bashrc pada masing2 home user.
Pengosongan file history bisa dilakukan pada crontab misal;

[root@penguin]# crontab -e
[insert]
59**** cat /dev/null >/root/.bash_history
[esc]
:wq [enter]

Perintah diatas akan mengosongakan file .bash_history pada direktory root setiap satu jam sekali atau tergantung anda setting waktunya.
Selalu berhati-hatilah ketika anda menjadi root.karena tindakan anda menjadi root mungkin mempengaruhi banyak hal jika tidak hati-hati.

demikianlah artikel ini saya buat semoga bermanfaat.

thanks to Allah to open my mind and my heart
thanks to my parent and my family for support and praying
thanks to all cartoonet crew that you all is brotherhood
thanks to mhamadt n friends #amunisi
thanks to hideident yang telah membimbingku

referensi : http://linux.or.id/
uncle google








Label:

posted by Nature 3 at 12:04 PM | 0 comments

my note: September 2006

"belajarlah untuk berani menjadi bodoh & ketahuilah segala kekuranganmu"


- who i'am -


Links

Blognya Teman-teman

apa kata mereka

Linux Registered