Tampilkan postingan dengan label CentOS. Tampilkan semua postingan
Tampilkan postingan dengan label CentOS. Tampilkan semua postingan

Cara Buat DNS WEB FTP SAMBA Server Di CENTOS 6.4



Pertama : siapkan dlu peralatan perang ente
- 2 Komputer, 1 client 1 server
- 2 NIC untuk server
- Kable cross dan straight.
- Centos 6.4
- Secangkir kopi, sebungkus rokok atau sebungkus kuaci :v
langkah 1, buat dns server 

install bind :
yum install bind* -y

tmbahkan tkj.com pada /etc/hosts
192.168.12.1    www.tkj.com
192.168.12.1    mail.tkj.com
#ini dua diatas ditambahkan, bukan ngedit 1 file hosts.

sekarang konfigurasi file /etc/named.conf ( hati hati, disini sensitip )
vi /etc/named.conf

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
    listen-on port 53 { 127.0.0.1; 192.168.12.1; }; //IP Yang di listen ip server kamu
    directory     "/var/named";
    dump-file     "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query     { localhost; 192.168.12.0/24; }; // alamat jaringan LAN kamu dengan client 
    recursion yes;

};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
    type hint;
    file "named.ca";
};
zone "tkj.com" IN { //SET DENGAN NAMA DOMAIN LOKAL YG KAMU MAU :P
   type master;
   file "/var/named/tkj.com.zone"; // ARAHKAN KE SINI, BOLEH DIGANTI, KARENA INI TEMPAT KONFIGURASI FILE tkj.com
   allow-update { none; };
};

zone "12.168.192.in-addr.arpa" IN { //ALAMAT JARINGAN KAMU YANG DIBALIK, MISAL 192.168.12 JADI 12.168.192
   type master;
   file "/var/named/12.168.192.rev"; //ARAHKAN KESINI 
   allow-update { none; };
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

konfigurasi lagi /var/named/tkj.com.zone < contoh saja sy memakai tkj.com

$TTL            86400
@                 IN SOA            tkj.com.  root.tkj.com. (
100     ; serial
1H      ; refresh
1M      ; retry
1W      ; expiry
1D )    ; minimum
@                    IN NS             ns1.tkj.com.
@                    IN A                 192.168.12.1
ns1                 IN A                 192.168.12.1
@                    IN MX   10      mail.tkj.com.
mail                IN A                 192.168.12.1
WWW               IN A                 192.168.12.1



konfigurasi lagi /var/named/12.168.192.rev :

$TTL    86400
@                 IN SOA          tkj.com. root.tkj.com. (
100     ; serial
1H      ; refresh
1M      ; retry
1W      ; expiry
1D)     ; minimum
@                IN NS            ns1.tkj.com.
1                 IN PTR          binggo.tkj.com.


Setelah itu restart service :
service named restart


Setelah itu Cek :
nslookup tkj.com

Server:         192.168.12.1
Address:        192.168.12.1#53

Name:   tkj.com
Address: 192.168.12.1

Berarti DNS server anda sudah berhasil. selamat * prok prok prok

Kedua Webserver :
Pertama Kita Install httpd dlu

[root@www ~]#yum -y install httpd
# remove welcome page
[root@www ~]#rm -f /etc/httpd/conf.d/welcome.conf
# remove default error page
[root@www ~]#rm -f /var/www/error/noindex.html
# create a link for Perl
[root@www ~]#ln -s /usr/bin/perl /usr/local/bin/perl

Kedua kita konfigurasi Webservernya :
[root@www ~]#vi /etc/httpd/conf/httpd.conf
# line 44: change
ServerTokens Prod
# line 76: change to ON
KeepAlive On
# line 262: Admin's address
ServerAdminroot@tkj.com
# line 276: change to your server's name
ServerName www.tkj.com:80 //untuk namanya 
# line 331: change (enable CGI and disable Indexes)
Options FollowSymLinks ExecCGI
# line 338: change
AllowOverride All
# line 402: add file name that it can access only with directory's name
DirectoryIndex index.html index.cgi index.php
# line 536: change
ServerSignature Off
# line 759: make it comment
#AddDefaultCharset UTF-8
# line 796: uncomment and add file-type that apache looks them CGI
AddHandler cgi-script .cgi .pl


[root@www ~]#/etc/rc.d/init.d/httpd start
Starting httpd:[ OK ]
[root@www ~]#chkconfig httpd on 

Ketiga, buat file indexnya, contoh 
[root@www ~]#vi /var/www/html/index.html
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Test Page
</div>
</body>
</html>

Ketiga FTP Server. 
Sebenarnya ada 2 aplikasi untuk ftp server, yaitu vsftp dan proftpd. yang sy gunakan yaitu vsproftpd karena simpel
oke kita mulai :
install dlu FTP server nya 
yum install -y vsftp

setelah kita install kita konfigurasi /etc/vsftpd.conf
Tambahkan pada line kosong : 

 anonymous_enable=NO  
 local_enable=YES  
 write_enable=YES  
 local_umask=022  
 anon_upload_enable=NO  
 local_root=/srv/ftp  
 anon_mkdir_write_enable=NO  
 xferlog_file=/var/log/vsftpd.log  
 ftpd_banner=Welcome to SM's FTP service.


Setelah itu, restart service dengan perintah :
service vsftp restart

note : 
Secara default direktori untuk pertukaran data berada di direktori /srv/ftp. Anda dapat menaruh beberapa file atau membuat folder untuk melihat hasil daripada konfigurasi FTP Server yang telah anda lakukan. Letakan semua file atau folder di direktori /srv/ftp.
untuk mengubah ganti local_root ke direktori yang anda mau. cth :
local_root=/var/ftp
+
 a. Anonymous FTP Server
1. Langkah pertama untuk membuat Anonymous FTP server adalah
dengan mengedit beberapa baris pada file /etc/vsftpd.conf. Lakukan
dengan perintah pico /etc/vsftpd.conf lalu tekan enter.
Uncoment pada bagian anonymous_enable=YES
2. Langkah selanjutnya adalah merestart service vsftpd dengan perintah :
/etc/init.d/vsftpd restart
3. Setelah itu lakukan pengujian dengan mengakses FTP Server tersebut
dari browser dengan mengetikkan :
ftp://ip_address
atau
nama_domain

Untuk membuktikan apakah FTP Server tersebut benar-benar sudah
dalam mode Anonymous, maka coba copy-kan sembarang file ke
directory download yang telah dibuat sebelumnya. Jika sudah,
selanjutnya coba akses lagi FTP Server tersebut dan download file
yang sudah kita masukan ke directory download tersebut.
Jika bisa didownload, maka FTP Server kita sudah berhasil dibuat
dengan mode Anonymous.

b. User FTP Server
1. Langkah pertama untuk membuat Anonymous FTP server adalah
dengan mengedit beberapa baris pada file /etc/vsftpd.conf. Lakukan
dengan perintah :
pico /etc/vsftpd.conf lalu tekan enter.
Uncomment pada bagian local_enable=YES
2. Selanjutnya buat satu user baru untuk menguji FTP Server tersebut.
Buat user baru dengan perintah adduser nama_user, misalnya :
adduser lindung lalu tekan enter.
3. Selanjutnya uji apakah FTP Server tersebut sudah bias digunakan
sebagai User FTP dengan mengakses alamat FTP Server tersebut.
Jika sudah muncul window untuk memasukkan username dan
password, masukkan username dan password dari user yang telah
dibuat tadi.


Keempat : 
PCROUTER CENTOS 6.4 .3 dkk
pertama matikan dlu firewall centos. di system -> administration -> firewall. disable 
kalau tidak bs melangkah ke langkah 2
kedua matikan NetworkManager  & aktifkan network

service NetworkManager stop

service network start

set eth0
DEVICE=eth0
BOOTPROTO=static
TYPE=Ethernet
IPADDR=192.168.1.2
NETMASK=255.255.255.0

set eth1
DEVICE=eth0
BOOTPROTO=static
TYPE=Ethernet
IPADDR=192.168.12.1
NETMASK=255.255.255.0

stelah itu, set ip gateway dari server. 
vi /etc/sysconfig/network
NETWORKING=yes
GATEWAY=192.168.1.1

Set DNS 
nameserver 192.168.12.1 // dns server yg kita set tadi
namserver 8.8.8.8 // backup

selanjutnya edit /etc/sysctl.conf
ubah / uncomment di bagian net.ipv4 = 0 
ubah jadi 1 dan uncomment

selanjutnya 
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -j MASQUERADE

selesai..

kini centos server anda sudah jadi PCROUTER, DNS, WEB, dan FTP server


Mau bikin Samba Sever Lagi ? ikuti langkah nya
Cara buat samba server : 

pertama kan sudah setting ip server dan client..

nah lanjut, 

add user samba, 

useradd tkj // atur user tkj
smbpasswd -a tkj // atur password tkj di samba

terus kita buat direktori yang kita mau share, misal kita mau share /home/tkj

mkdir /home/tkj/samba // dibuat dlu gan :D
chmod 777 /home/tkj/samba -R // -R untuk mnampilkan semua yang ada di dalam direktori

sudah itu toh, konfigurasi /etc/samba/samba.conf
nah, di bagian security = user, ubah dia jadi security = share biar bisa semua.. next
bikin mi path yang mau di share 

[nama mau dishare ini gan]
path = /home/tkj #ini yang mau kita share
browseable = yes # biar bisa di browse 
writeable = yes # biar bisa di write sama user wedus
guest = yes # adakan saja.. paganna ganna ju

setelah itu kita service samba restart atau service smb restart atau /etc/init.d/smb restart

test deh, ketik testparm dan lihat apakah direktori yang anda share ada atau tidak, kalau tidak silahkan diulang dolo :D

Cara Buat PCROUTER FTP WEB dan DNS SERVER DI CENTOS 6.X


Pertama : siapkan dlu peralatan perang ente
- 2 Komputer, 1 client 1 server
- 2 NIC untuk server
- Kable cross dan straight.
- Centos 6.4
- Secangkir kopi, sebungkus rokok atau sebungkus kuaci :v


langkah 1, buat buat pcrouter

install bind :
yum install bind* -y

sekarang konfigurasi file /etc/named.conf ( hati hati, disini sensitip )
vi /etc/named.conf

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
    listen-on port 53 { 127.0.0.1; 192.168.12.1; }; //IP Yang di listen ip server kamu
    directory     "/var/named";
    dump-file     "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query     { localhost; 192.168.12.0/24; }; // alamat jaringan LAN kamu dengan client
    recursion yes;

};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
    type hint;
    file "named.ca";
};
zone "tkj.com" IN { //SET DENGAN NAMA DOMAIN LOKAL YG KAMU MAU :P
   type master;
   file "/var/named/tkj.com.zone"; // ARAHKAN KE SINI, BOLEH DIGANTI, KARENA INI TEMPAT KONFIGURASI FILE tkj.com
   allow-update { none; };
};

zone "12.168.192.in-addr.arpa" IN { //ALAMAT JARINGAN KAMU YANG DIBALIK, MISAL 192.168.12 JADI 12.168.192
   type master;
   file "/var/named/12.168.192.rev"; //ARAHKAN KESINI
   allow-update { none; };
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

konfigurasi lagi /var/named/tkj.com.zone < contoh saja sy memakai tkj.com

$TTL            86400
@                 IN SOA            tkj.com.  root.tkj.com. (
100     ; serial
1H      ; refresh
1M      ; retry
1W      ; expiry
1D )    ; minimum
@                    IN NS             ns1.tkj.com.
@                    IN A                 192.168.12.1
ns1                 IN A                 192.168.12.1
@                    IN MX   10      mail.tkj.com.
mail                IN A                 192.168.12.1
WWW               IN A                 192.168.12.1


konfigurasi lagi /var/named/12.168.192.rev :

$TTL    86400
@                 IN SOA          tkj.com. root.tkj.com. (
100     ; serial
1H      ; refresh
1M      ; retry
1W      ; expiry
1D)     ; minimum
@                IN NS            ns1.tkj.com.
1                 IN PTR          binggo.tkj.com.


Setelah itu restart service :
service named restart


Setelah itu Cek :
nslookup tkj.com

Server:         192.168.12.1
Address:        192.168.12.1#53

Name:   tkj.com
Address: 192.168.12.1

Berarti DNS server anda sudah berhasil. selamat * prok prok prok

Kedua Webserver :
Pertama Kita Install httpd dlu

[root@www ~]#yum -y install httpd
# remove welcome page
[root@www ~]#rm -f /etc/httpd/conf.d/welcome.conf
# remove default error page
[root@www ~]#rm -f /var/www/error/noindex.html
# create a link for Perl
[root@www ~]#ln -s /usr/bin/perl /usr/local/bin/perl

Kedua kita konfigurasi Webservernya :
[root@www ~]#vi /etc/httpd/conf/httpd.conf
# line 44: change
ServerTokens Prod
# line 76: change to ON
KeepAlive On
# line 262: Admin's address
ServerAdminroot@tkj.com
# line 276: change to your server's name
ServerName www.tkj.com:80 //untuk namanya
# line 331: change (enable CGI and disable Indexes)
Options FollowSymLinks ExecCGI
# line 338: change
AllowOverride All
# line 402: add file name that it can access only with directory's name
DirectoryIndex index.html index.cgi index.php
# line 536: change
ServerSignature Off
# line 759: make it comment
#AddDefaultCharset UTF-8
# line 796: uncomment and add file-type that apache looks them CGI
AddHandler cgi-script .cgi .pl


[root@www ~]#/etc/rc.d/init.d/httpd start
Starting httpd:[ OK ]
[root@www ~]#chkconfig httpd on

Ketiga, buat file indexnya, contoh
[root@www ~]#vi /var/www/html/index.html
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Test Page
</div>
</body>
</html>

Ketiga FTP Server.
Sebenarnya ada 2 aplikasi untuk ftp server, yaitu vsftp dan proftpd. yang sy gunakan yaitu vsproftpd karena simpel
oke kita mulai :
install dlu FTP server nya
yum install -y vsftp

setelah kita install kita konfigurasi /etc/vsftpd.conf
Tambahkan pada line kosong :

 anonymous_enable=NO 
 local_enable=YES 
 write_enable=YES 
 local_umask=022 
 anon_upload_enable=NO 
 local_root=/srv/ftp 
 anon_mkdir_write_enable=NO 
 xferlog_file=/var/log/vsftpd.log 
 ftpd_banner=Welcome to SM's FTP service.


Setelah itu, restart service dengan perintah :
service vsftp restart

note :
Secara default direktori untuk pertukaran data berada di direktori /srv/ftp. Anda dapat menaruh beberapa file atau membuat folder untuk melihat hasil daripada konfigurasi FTP Server yang telah anda lakukan. Letakan semua file atau folder di direktori /srv/ftp.
untuk mengubah ganti local_root ke direktori yang anda mau. cth :
local_root=/var/ftp
+
 a. Anonymous FTP Server
1. Langkah pertama untuk membuat Anonymous FTP server adalah
dengan mengedit beberapa baris pada file /etc/vsftpd.conf. Lakukan
dengan perintah pico /etc/vsftpd.conf lalu tekan enter.
Uncoment pada bagian anonymous_enable=YES
2. Langkah selanjutnya adalah merestart service vsftpd dengan perintah :
/etc/init.d/vsftpd restart
3. Setelah itu lakukan pengujian dengan mengakses FTP Server tersebut
dari browser dengan mengetikkan :
ftp://ip_address
atau
nama_domain

Untuk membuktikan apakah FTP Server tersebut benar-benar sudah
dalam mode Anonymous, maka coba copy-kan sembarang file ke
directory download yang telah dibuat sebelumnya. Jika sudah,
selanjutnya coba akses lagi FTP Server tersebut dan download file
yang sudah kita masukan ke directory download tersebut.
Jika bisa didownload, maka FTP Server kita sudah berhasil dibuat
dengan mode Anonymous.

b. User FTP Server
1. Langkah pertama untuk membuat Anonymous FTP server adalah
dengan mengedit beberapa baris pada file /etc/vsftpd.conf. Lakukan
dengan perintah :
pico /etc/vsftpd.conf lalu tekan enter.
Uncomment pada bagian local_enable=YES
2. Selanjutnya buat satu user baru untuk menguji FTP Server tersebut.
Buat user baru dengan perintah adduser nama_user, misalnya :
adduser lindung lalu tekan enter.
3. Selanjutnya uji apakah FTP Server tersebut sudah bias digunakan
sebagai User FTP dengan mengakses alamat FTP Server tersebut.
Jika sudah muncul window untuk memasukkan username dan
password, masukkan username dan password dari user yang telah
dibuat tadi.


Keempat :
PCROUTER CENTOS 6.4 .3 dkk
pertama matikan dlu firewall centos. di system -> administration -> firewall. disable
kalau tidak bs melangkah ke langkah 2
kedua matikan NetworkManager  & aktifkan network

service NetworkManager stop

service network start

set eth0
DEVICE=eth0
BOOTPROTO=static
TYPE=Ethernet
IPADDR=192.168.1.2
NETMASK=255.255.255.0

set eth1
DEVICE=eth1
BOOTPROTO=static
TYPE=Ethernet
IPADDR=192.168.12.1
NETMASK=255.255.255.0

stelah itu, set ip gateway dari server.
vi /etc/sysconfig/network
NETWORKING=yes
GATEWAY=192.168.1.1

Set DNS
nameserver 192.168.12.1 // dns server yg kita set tadi
namserver 8.8.8.8 // backup

selanjutnya edit /etc/sysctl.conf
ubah / uncomment di bagian net.ipv4 = 0
ubah jadi 1 dan uncomment

selanjutnya
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -j MASQUERADE

selesai..

kini centos server anda sudah jadi PCROUTER, DNS, WEB, dan FTP server

selanjutnya
set ip client 1 jaringan sama server dan GW client adalah nic server (eth1)

kalau masih belum reply dari client, masukan
iptables -F
pada server
selesai..

kini centos server anda sudah jadi PCROUTER, DNS, WEB, dan FTP server
#note, untuk mengaktifkan pada startup anda bisa menggunakan perintah :
chkconfig --level 35 network on
chkconfig NetworkManager off
chkconfig vsftp on
chkconfig httpd on
chkconfig named on

:v

Konfigurasi FTP Server Di CentOS 6.4 Menggunakan vsftpd



This tutorial shows you how to install and configure FTP server in CentOS 6.3. Though the steps provided here are tested in CentOS 6.3, it should work on RHEL 6.x(x stands for version) and Scientific Linux 6.x too. In this tutorial my ftp server ip and hostname are 192.168.1.200 and mainserver.ostechnix.com respectively. I have already configured a local repository and i am gonna to install FTP from my local repository. For more information navigate to setup your local repoistory in CentOS 6 / RHEL 6 / Scientific Linux.
Before proceed, stop the firewall.
[root@mainserver ~]# service iptables stop
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@mainserver ~]# service ip6tables stop
ip6tables: Flushing firewall rules:                        [  OK  ]
ip6tables: Setting chains to policy ACCEPT: filter         [  OK  ]
ip6tables: Unloading modules:                              [  OK  ]
[root@mainserver ~]# chkconfig iptables off
[root@mainserver ~]# chkconfig ip6tables off
[root@mainserver ~]# 
Now let us install FTP service.
[root@mainserver ~]# yum install -y vsftpd
[root@mainserver ~]# Start vsftpd service.
[root@mainserver ~]# service vsftpd start
Starting vsftpd for vsftpd:                                [  OK  ]
[root@mainserver ~]# 
 
Enable vsftpd in multi-user levels.
[root@mainserver ~]# chkconfig vsftpd on
Now edit the /etc/vsftpd/vsftpd.conf file. Uncomment and edit the lines in the vsftpd.conf file which are shown in bold.
[root@mainserver ~]# cat /etc/vsftpd/vsftpd.conf 
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# The target log file can be vsftpd_log_file or xferlog_file.
# This depends on setting xferlog_std_format parameter
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# The name of log file when xferlog_enable=YES and xferlog_std_format=YES
# WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
#xferlog_file=/var/log/xferlog
#
# Switches between logging into vsftpd_log_file and xferlog_file files.
# NO writes to vsftpd_log_file, YES to xferlog_file
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
ascii_upload_enable=YES
ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to OSTECHNIX FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
use_localtime=YES
Now let us restart the vsftpd service and try to connect to ftp server.
[root@mainserver ~]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
Connect to the ftp server.
Note: Root is not allowed to connect to ftp server by default for security purpose. So lets us create a new user called ostechnix.
[root@mainserver ~]# useradd ostechnix
[root@mainserver ~]# passwd ostechnix
Changing password for user ostechnix.
New password: 
BAD PASSWORD: it is based on a dictionary word
Retype new password: 
passwd: all authentication tokens updated successfully.
Connet to FTP server using the new user ostechnix.
[root@mainserver ~]# ftp 192.168.1.200
-bash: ftp: command not found
[root@mainserver ~]# 
 Oops! ftp package is not installed. So let us install ftp package first.
[root@mainserver ~]# yum install -y ftp
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ftp.i686 0:0.17-51.1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
 Package       Arch           Version                 Repository           Size
================================================================================
Installing:
 ftp           i686           0.17-51.1.el6           localrepo            55 k
Transaction Summary
================================================================================
Install       1 Package(s)
Total download size: 55 k
Installed size: 91 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : ftp-0.17-51.1.el6.i686                                       1/1 
  Verifying  : ftp-0.17-51.1.el6.i686                                       1/1 
Installed:
  ftp.i686 0:0.17-51.1.el6                                                      
Complete!
[root@mainserver ~]# 


Again connect to the FTP server.
[root@mainserver ~]# ftp 192.168.1.200
Connected to 192.168.1.200 (192.168.1.200).
220 Welcome to OSTECHNIX FTP service.
Name (192.168.1.200:root): ostechnix
331 Please specify the password.
Password:
500 OOPS: cannot change directory:/home/ostechnix
Login failed.
ftp> 
It shows a error that the user cannot change to his $HOME directory. Type exit to return back from the ftp console and allow vsftpd daemon to change users into their $HOME directories. To do that update SELinux configuration using the command below.
[root@mainserver ~]# setsebool -P ftp_home_dir on
And finally connect to the FTP server.
[root@mainserver ~]# ftp 192.168.1.200
Connected to 192.168.1.200 (192.168.1.200).
220 Welcome to OSTECHNIX FTP service.
Name (192.168.1.200:root): ostechnix
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/home/ostechnix"
ftp> 
Its working now. You can use your FTP server.

Connect to FTP server using Filezilla from Client:

Download and install Filezilla client software to any one of the client systems. Open the Filezilla client and enter the username and password which we have created earlier and click connect.

Connect to FTP server via browser from the client:

Open the browser and navigate to ftp://192.1168.1.200. Enter the username and password which we cretaed earlier.
If you want to browse ftp server using domain name(i.e ftp://ostechnix.com) instead of ip address, add the ftp server ip in the DNS server records. For more information to configure DNS server navigate to Setup DNS server in CentOS 6.3/RHEL 6.3/Scientific Linux 6.3.
Thats it. You can access your FTP server from any client now using Filezilla and as well as from your client web browser.
To Change Directory, just add 
anon_root=/yourdirectory
local_root=/yourdirectory
have a nc day :D

Cara Membuat PC Router Dengan CentOS 6.3

Kali ini saya akan share bagaimana membuat router dengan linux Centos6 .3. Linux Centos merupakan turunan dari distro besar linux Redhat ada juga yang menyebutnya sebagai sistem operasi bebas yang didasarkan pada Red Hat Enterprise Linux (RHEL). Centos adalah singkatan dari Community ENTerprise Operating System ( Sistem Operasi Perusahaan Buatan Komunitas/Masyarakat).
Adapun peralatan yang dibutuhkan diantaranya  yang digunakan di sini  yaitu:
  • PC satu buah untuk dijadikan sebagai router dengan  spesifikasi : RAM 512, Procesor Intel Pentium IV,NIC 2 buah,hardisk 80 GB,CD/DVD rom,monitor, keyboard.
  • Satu buah Laptop sebagai client
  • 1 CD Linux CentOS (buat diinstall)
  • HUB
  • Kabel UTP dan konektor 45 secukupnya
  • Crimping  kabel.
Topologi yang saya gunakan di sini adalah sebagai berikut :


Ok, saya asumsikan centos sudah berhasil di install.
selanjutnya kita akan menkonfigurasi jaringan, diawali dengan konfigurasi ip.  Disini kita menggunakan 2 ip yang satu ke internet(eth0) dan yang satu lagi untuk jaringan lokal(eth1). 
Untuk mengkonfigurasi IP pada linux server centos, ikuti langkah  sebagai berikut :

Edit file /etc/network/interface

[root@hacker ~]# vi /etc/network/interfaces
Lalu tambahkan baris berikut :
auto eth0
iface eth0 inet static
address 10.10.10.179
netmask 255.255.255.0
network 10.10.10.0
broadcast 10.10.10.255
gateway 10.10.10.1
auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.1
broadcast 192.168.1.255

Simpan hasil file yang di-edit. Setelah itu restart network, dengan mengetikan perintah :
[root@hacker ~]# /etc/init.d/networking restart

Untuk melihat hasil IP Address nya ketik :

[root@hacker ~]#  ifconfig
maka akan terlihat seperti berikut :
eth0      Link encap:Ethernet HWaddr 00:0C:29:7A:84:18 inet addr: 10.10.10.179 Bcast: 10.10.10.255 Mask: 255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1347 errors:0 dropped:0 overruns:0 frame:0 TX packets:901 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:126581 (123.6 KiB) TX bytes:95021 (92.7 KiB) Interrupt:10 Base address:0×2000
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:3924 Metric:1 RX packets:73 errors:0 dropped:0 overruns:0 frame:0 TX packets:73 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:5923 (5.7 KiB) TX bytes:5923 (5.7 KiB)
eth1  Link encap:Ethernet HWaddr 00:0C:29:7A:84:18 inet addr:192.168.1.1  Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1347 errors:0 dropped:0 overruns:0 frame:0 TX packets:901 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:126581 (123.6 KiB) TX bytes:95021 (92.7 KiB) Interrupt:10 Base address:0×2000


Selanjutnya Konfigurasi Server sebagai Router.
Hilangkan tanda # pada baris net/ipv4/ip_forward=1 di dalam file /etc/sysctl.conf.
[root@hacker ~]# vi /etc/sysctl.conf
Sebelumnya :
#net/ipv4/ip_forward=0
Menjadi :
net/ipv4/ip_forward=1

Setelah itu simpan hasil konfigurasi, dan aktifkan konfigurasi sysctl dengan perintah.
[root@hacker ~]#  nano sysctl –p
Karena internet mengenal IP Public, maka perlu diatur agar jaringan client dengan ip local/private bisa digunakan untuk berinternet. Maka disini kita menggunakan MASQUERADING, dengan masquerading maka jaringan local akan diwakilkan dengan IP public di sisi router. Untuk mengatur masquerading, gunakan perintah berikut:

[root@hacker ~]#  iptables –t nat –A POSTROUTING –s 192.168.1.0/24 –d 0/0 –j MASQUERADE
Perintah iptables di atas hanya bersifat sementara, jika di reboot maka perintah iptables yang kita buat akan hilang. Untuk menjadikan, maka perintah iptables untuk masquerading tersebut sebaiknya di simpan di suatu file yang bernama /etc/rc.local. 
Sebelumnya lakukan ping ke client, ke url misalnya: facebook.com. Jika berhasil reply baru Edit file /etc/rc.local, lalu tambah perintah iptable di atas supaya bisa jadi permanen.

[root@hacker ~]#  nano /etc/rc.local
Iptables –t nat –A POSTROUTING –S 192.168.1.0/24 –d 0/0 –j MASQUERADE
Simpan konfigurasi tersebut dengan tekan tombol Ctrl+ x
Restart komputer.

[root@hacker ~]#  reboot
Setelah itu lihat konfigurasi Masquerade kita pada iptables, ketik :

[root@hacker ~]#  nano iptables -L -t nat
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all — 192.168.1.0/24 anywhere

Cara install Flash player di CentOS

This is guide, howto install Adobe Flash Player Plugin version 11.2 (32-bit and 64-bit) with YUM on Fedora 18/17/16/15/14/13/12, CentOS 6.3/6.2/6.1/6/5.8 and Red Hat (RHEL) 6.3/6.2/6.1/6/5.8. Using Adobe’s own YUM repository it is very easy also keep up-to-date with Flash Player Plugin. Finally also native 64-bit (x86_64) version of Adobe Flash Player is available for Linux users.

1. Change Root User

sudo -i
## OR ##
su -

2. Install Adobe YUM Repository RPM package

## Adobe Repository 32-bit x86 ##
rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
 
## Adobe Repository 64-bit x86_64 ##
rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

3. Update Repositories

yum check-update

4a. Install Adobe Flash Player 11.2 on Fedora 18/17/16/15/14/13/12, CentOS 6.3/6.2/6.1/6 and Red Hat (RHEL) 6.3/6.2/6.1/6

Fedora 18/17/16/15/14/13/12, CentOS 6 and Red Hat (RHEL) 6 32-bit and 64-bit version

yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl

4b. Install Adobe Flash Player 11.2 on CentOS 5.8 and Red Hat (RHEL) 5.8

CentOS and Red Hat 32-bit and 64-bit version

yum groupinstall "Sound and Video"
 
yum install flash-plugin nspluginwrapper curl

5. Verify that the Flash Player Plugin is working

Open Mozilla Firefox and write about:plugins on address bar. Results should look like following:

Adobe Flash Player 64-bit on Firefox 17, installed on Fedora 18 64-bit (x86_64)

Adobe Flash Plugin on Firefox 17 Fedora 18

Adobe Flash Player 64-bit installed on Fedora 16 64-bit (x86_64)


CentOS 5.8 and Red Hat 5.8


Then open following page for real testing Adobe Flash Plugin:
Check is Adobe Flash Plugin Working