Anda di halaman 1dari 19

`

SMK Pasundan 2 Bandung

Modul Admin Server


Debian Lenny
By obi abbiyu

2012

linux open source


Konfigurasi IP Address dan
Hostname

Masuk kedalam system sebagai user root ketika login pertama :

Untuk konfigurasi IP Address dari mode teks dapat dilakukan dengan cara.

#vim /etc/network/interfaces

Untuk mengganti hostname dari mode teks dapat dilakukan dengan cara berikut:

#vim /etc/hostname

Restart service networknya dengan perintah:

#/etc/init.d/networking restart
Lakukan perintah ifconfig untuk mengecek ip address yang sudah kita setting

Maka konfigurasi IP Address dan hostname sudah berfungsi dengan baik.


INSTALASI DAN KONFIGURASI
DHCP SERVER

Sebelum mengkonfigurasi DHCP Server, install terlebih dahulu paket dhcp3-server . Masukan DVD
Linux Debian Lenny kedalam DVD-ROM. Cek apakah paket dhcp3-server sudah terinstall.
Perintahnya :

#dpkg -l |grep dhpc3-server

Perintah diatas Adalah untuk mencari query program yang mengandung kata dhcp3-server, jika
telah terinstall maka yang muncul Adalah:

KONFIGURASI DHCP Server

Buka file dhcpd.conf didalam direktori /etc/dhcp3 dengan perintah :

#vim /etc/dhcp3/dhcpd.conf

Kemudian cari baris berikut, sesuaikan dengan konfigurasi server kita.

Ubah yang bertanda pagar di sesuaikan dengan konfigurasi server kita, misalnya seperi dibawah:
Kemudian restart service dari dhcp server mengunakan perintah:

#/etc/init.d/dhcp3-server restart

Jika tidak muncul pesan, maka kemungkinan konfigurasi dhcp server telah berhasil. Untuk melihat
hasilnya maka atur IP Address di windows XP menjadi Obtain by DHCP.
KONFIGURASI DNS
SERVER

Cek apakah paket bind9 sudah terinstall dengan perintah :

#dpkg -l | grep bind9

Jika sudah terinstall selanjutnya melakukan konfigurasi file-file utk membuat DNS Server,
diantaranya:
 File hosts
 File resolv.conf
 File named.conf
 File db.local yang dirubah menjadi file forward
 File db.127 yang dirubah menjadi file reverse

Konfigurasi DNS Server

Tambahkan ip dan domain pada file hosts dan resolv.conf:


#vim /etc/hosts

Ubah nameserver pada file resolv.conf


#vim /etc/resolv.conf

Ubah file named.conf

#vim named.conf
tambahkan konfigurasi untuk domain ujikom2012.com pada baris terakhir diatas include, seperti
terlihat pada script dibawah.

Buat directory ujikom dan gandakan sekaligus rubah nama file db.local menjadi forward, db.127
menjadi reverse dengan perintah sebagai berikut:

# mkdir /etc/bind/ujikom
# cp /etc/bind/db.local /etc/bind/ujikom/forward
# cp /etc/bind/db.127 /etc/bind/ujikom/reverse

Ubah file forward di bawah ini:


#vim /etc/bind/ujikom/forward

Sesuaikan domain dan ip yang telah kita konfigurasi sebelumnya:

Ubah file reverse:

#vim /etc/bind/ujikom/reverse
Sesuaikan dengan domain yang akan kita buat:

Restart service bind dengan menggunakan perintah:

#/etc/init.d/bind9 restart

Jalankan perintah nslookup dan dig untuk mengecek apakah konfigurasi DNS telah berjalan.
#nslookup www.ujikom2012.com
#dig www.ujikom2012.com
FTP SERVER

Instalasi FTP Server

Install terlebih dahulu paket proftpd

#apt-get install proftpd

Pada pilihan yang muncul pilih Stand Alone

Konfigurasi FTP SERVER

#vim /etc/proftpd/proftpd.conf

Edit file proftpd.conf yang di bold menjadi seperti script dibawah:

# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.


# To really apply changes reload proftpd after modifications.
#

# Includes DSO modules


Include /etc/proftpd/modules.conf

# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6 off
# If set on you can experience a longer connection delay in many cases. IdentLookups off

ServerName “ujikom2012.com“
ServerType standalone DeferWelcome
off

MultilineRFC2228 on
DefaultServer on
ShowSymlinks on

TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200

DisplayLogin welcome.msg
DisplayChdir .message true
ListOptions “-l“

DenyFilter \*.*/

# Use this to jail all users in their homes


# DefaultRoot ~

# Users require a valid shell listed in /etc/shells to login.


# Use this directive to release that constrain.
# RequireValidShell off

# Port 21 is the standard FTP port. Port 21

# In some cases you have to specify passive ports range to by-pass


# firewall limitations. Ephemeral ports can be used for that, but
# feel free to use a more narrow range.
PassivePorts 30000 30100

# If your host was NATted, this option is useful in order to


# allow passive tranfers to work. You have to use your public
# address and opening the passive ports used on your firewall as well.
# MasqueradeAddress 1.2.3.4

# This is useful for masquerading address with dynamic IPs:


# refresh any configured MasqueradeAddress directives every 8 hours
<IfModule mod_dynmasq.c>
# DynMasqRefresh 28800
</IfModule>

# To prevent DoS attacks, set the maximum number of child processes


# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 30

# Set the user and group that the server normally runs at. User proftpd
Group nogroup

# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable. Umask 022 022
# Normally, we want files to be overwriteable.
AllowOverwrite on
# Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:
# PersistentPasswd off

# This is required to use both PAM—based authentication and local passwords


# AuthOrder mod_auth_pam.c* mod_auth_unix.c
# Be warned: use of this directive impacts CPU average load!
# Uncomment this if you like to see progress and transfer rate with ftpwho

# in downloads. That is not needed for uploads rates.


#
# UseSendFile off

TransferLog /var/log/proftpd/xferlog
SystemLog /var/log/proftpd/proftpd.log

<IfModule mod_quotatab.c>
QuotaEngine off
</IfModule>

<IfModule mod_ratio.c> Ratios off


</IfModule>

# Delay engine reduces impact of the so—called Timing Attack described in


# http://security.lss.hr/index.php?page=details&ID=LSS—2004—10—02
# It is on by default.
<IfModule mod_delay.c>
DelayEngine on
</IfModule>

<IfModule mod_ctrls.c> ControlsEngine


off
ControlsMaxClients 2
ControlsLog /var/log/proftpd/controls.log
ControlsInterval 5
ControlsSocket /var/run/proftpd/proftpd.sock
</IfModule>

<IfModule mod_ctrls_admin.c>
AdminControlsEngine off
</IfModule>

#
# Alternative authentication frameworks
#
#Include /etc/proftpd/ldap.conf
#Include /etc/proftpd/sql.conf

#
# This is used for FTPS connections
#
#Include /etc/proftpd/tls.conf

# A basic anonymous configuration, no upload directories.

<Anonymous ~ftp>
User ftp
Group nogroup
# # We want clients to be able to login with “anonymous“ as well as “ftp“ UserAlias anonymous ftp
# # Cosmetic changes, all files belongs to ftp user
DirFakeUser on ftp
DirFakeGroup on ftp
#
RequireValidShell off
#

# # Limit the maximum number of anonymous logins

MaxClients 10
#
# # We want ’welcome.msg’ displayed at login, and ’.message’ displayed
# # in each newly chdired directory.
DisplayLogin welcome.msg
DisplayChdir .message
# # Limit WRITE everywhere in the anonymous chroot
<Directory /home/test/>
<Limit WRITE>
AllowAll
</Limit>
</Directory>
#
# # Uncomment this if you’re brave.
# # <Directory incoming>
# # # Umask 022 is a good standard umask to prevent new files and dirs
# # # (second parm) from being group and world writable.
# # Umask 022 022
# # <Limit READ WRITE>
# # DenyAll
# # </Limit>
# # <Limit STOR>
# # AllowAll
# # </Limit>
# # </Directory>
#
#</Anonymous>

Restart service proftpd

#/etc/init.d/proftpd restart

Menjalankan Layanan FTP

Untuk mencek apakah FTP sudah berjalan dengan benar, buka browser di linux kemudian
ketikan pada url dengan ftp://ujikom2012.com , dan ftp://namauser@ujikom2012.com

Maka seharusnya yang tampil adalah seperti pada gambar dibawah ini:
Gambar tampilan dengan anonymous

Gambar tampilan authentifikasi user dengan password


PROXY SERVER

Proxy server berfungsi untuk membuat salinan data yang dibaca dari Internet ke jaringan lokal
kita sehingga jika di lain waktu kita mengakses data yang sama, maka data tersebut akan diambil
dari jaringan lokal kita sehingga akan sangat menghemat bandwith kita ke Internet. Squid adalah
aplikasi proxy server yang paling stabil dan paling umum digunakan untuk sistem operasi Linux.

Aktifkan IP Forwading nya..

#echo “1” > /proc/sys/net/ipv4/ip_forward


#iptables –t nat –A POSTROUTING –o eth0 –j MASQUERADE

kemudian restart konfigurasi networknya

#/etc/init.d/networking restart

KONFIGURASI SQUID

Langkah berikutnya, carilah perintah berikut :

#vim /etc/squid/squid.conf

# ACCESS CONTROLS

# ------------------

Baris perintah berikut ini digunakan untuk mendefinisikan daftar hak akses dalam jaringan anda,

squid menyebutnya dengan Access Control Lists (ACL). Anda dapat mendefinisikan beberapa
ACL
disini.

Dalam bagian access controls ini, carilah baris perintah berikut :


Carilah baris yang berisi perintah berikut :

#Examples:
#acl macaddress arp 09:00:2b:23:45:67
#acl myexample dst_as 1241
#acl password proxy_auth REQUIRED
#acl fileupload req_mime_type -i Amultipart/form-data$
#acl javascript rep_mime_type -i Aapplication/x-javascript$
#
#Recommended minimum configuration:
acl all src all
acl manager proto cache_object acl localhost src 127.0.0.1/32
acl lan src 192.168.1.0/24
acl to_localhost dst 127.0.0.0/8
acl situs url_regex “/etc/squid/blokir.txt“
acl terlarang url_regex -i “/etc/squid/kataterlarang.txt“
#

#good idea to have an “deny all“ or “allow all“ entry at the end
# of your access lists to avoid potential confusion.
#
#Default:
# http_access deny all
#
#Recommended minimum configuration:
#
# Only allow cachemgr access from localhost
http_access deny situs
http_access deny terlarang
http_access allow lan
http_access allow manager localhost

http_access deny manager


# Only allow purge requests from localhost http_access allow
purge localhost http_access deny purge
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports http_access
deny CONNECT !SSL_ports
#
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on “localhost“ is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

# Example rule allowing access from your local networks.


# Adapt localnet in the ACL section to list your (internal) IP
networks
# from where browsing should be allowed
#http_access allow localnet http_access
allow localhost
# And finally deny all other access to this proxy http_access deny all

tambahkan transparent di baris 1117


# Squid normally listens to port 3128
http_port 3128 transparent

tambahkan visible_hostname di baris 3373

# TAG: cache_effective_group
# If you want Squid to run with a specific GID regardless of
# the group memberships of the effective user then set this
# to the group (or GID) you want Squid to run as. When set
# all other group privileges of the effective user is ignored
# and only this GID is effective. If Squid is not started as
# root the user starting Squid must be member of the specified
# group.
#
#Default:
# none
visible_hostname ujikom2012.com

buat file di /etc/squid/kataterlarang.txt

#vim /etc/squid/kataterlarang.txt

crack hack
cracker

buat file di /etc/squid/blokir.txt

#vim /etc/squid/blokir.txt
Facebook.com
Hacker.org
Cracker.org

Sebelum squid dapat berjalan, anda harus menciptakan direktori swap. Lakukanlah
dengan menjalankan perintah :

#/etc/init.d/squid restart
KONFIGURASI TRANSPARENT PROXY

Langkah terakhir adalah untuk mengkonfigurasi squid menjadi transparent proxy ketikan
perintah berikut di terminal dengan:

#iptables –t nat –A PREROUTING –p tcp --dport 80 –j REDIRECT --to-port 3128

Coba buka web yang telah dibuat sebelumnya yang telah terdaftar di blokir.txt dan
situsterlarang.txt
Jika konfigurasi sudah benar maka akan muncul seperti pada gambar yang menyatakan bahwa
situs berhasil terblokir :

Untuk melihat history apa saja web yang pernah dibuka oleh komputer klien maka ketikan
perintah berikut:

#tail -f /var/log/squid/access,log

1290024442.959 11335 192.168.1.2 TCP_MISS/200 2498 GET http://www.smktelkom.sch.id/ - DIRECT/192.168.1.1


text/html

1290024443.214 253 192.168.1.2 TCP_REFRESH_HIT/304 388 GET http://www.smktelkom.sch.id/wp-


content/themes/twentyten/style.css - DIRECT/192.168.1.1 -

1290024443.218 59 192.168.1.2 TCP_REFRESH_HIT/304 388 GET http://www.smktelkom.sch.id/wp-


content/themes/twentyten/images/headers/path.jpg - DIRECT/192.168.1.1 -

1290024443.306 87 192.168.1.2 TCP_REFRESH_HIT/304 387 GET http://www.smktelkom.sch.id/wp-


content/themes/twentyten/images/wordpress.png - DIRECT/192.168.1.1 -

1290024443.350 44 192.168.1.2 TCP_MISS/404 766 GET http://www.smktelkom.sch.id/favicon.ico


- DIRECT/192.168.1.1 text/html

1290024489.758 2 192.168.1.2 TCP_DENIED/403 1432 GET http://www.cracker.org/ - NONE/- text/html

Anda mungkin juga menyukai