Friday, September 5, 2014

HOW TO INSTALL OPENVPN on CENTOS

hope this will be useful
==================== 
1. Open Your VPS with putty
2. have to login with root access
---
ensure TUN /TAP is active
check it with type this command :
cat /dev/net/tun
the answer must be : file descriptor in bad state 
---------------------------------
3. and then enter this command :
CENTOS 5 32bit
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
CENTOS 5 64bit
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
CENTOS 6 32 bit
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
CENTOS 6 64bit
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

ALL CENTOS 5 


rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm
rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm
ALL CENTOS 6 
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt (abaikan jika gagal)
rpm -K rpmforge-release-0.5.3-1.el6.rf.*.rpm
rpm -i rpmforge-release-0.5.3-1.el6.rf.*.rpm
yum install openvpn -y
cp -r /usr/share/doc/openvpn-2.2.2/easy-rsa/ /etc/openvpn/
TAKE A NOTE for CENTOS 6
need a little modification
yum -y install nano
nano /etc/openvpn/easy-rsa/2.0/vars
then  EDIT this line : 

export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA`


change line above with this  :

export KEY_CONFIG=/etc/openvpn/easy-rsa/2.0/openssl-1.0.0.cnf

and then SAVE (Ctrl+x) (Y) (ENTER)


cd /etc/openvpn/easy-rsa/2.0/
chmod +x *
source ./vars
./vars
./clean-all
./build-ca
Just type enter, except for COMMON NAME (fill it with what ever you like)
then :
./build-key-server server
Please take attention
when u got notification (twice) choose Y (y)
----------------------------------------
./build-dh
wait until its done
and then enter this command :


cp -r /etc/openvpn/easy-rsa/2.0/keys/ /etc/openvpn/keys/
cp /etc/openvpn/keys/ca.crt /etc/openvpn/ 


cd /etc/openvpn/

make response to TUN driver
cat > server.conf <<END
dev tun*
END 

build server configuration :


cat > groundworld.conf <<END
port 443
proto tcp
dev tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key
dh /etc/openvpn/keys/dh1024.pem
plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login
client-cert-not-required
username-as-common-name
server 10.9.8.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 5 30
comp-lzo
persist-key
persist-tun
status server-tcp.log
verb 3
END

 Forwarding Port
echo 1 > /proc/sys/net/ipv4/ip_forward

Iptables Route rules
iptables -t nat -A POSTROUTING -s 10.9.8.0/24 -o venet0 -j SNAT --to xxx.xxx.xxx.xxx

xxx.xxx.xxx.xxx above, change it with your vps address
run openvpn on the server
service openvpn start
chkconfig openvpn on
chkconfig --add openvpn
DONE !!

Thursday, September 4, 2014

How To install Dropbear on Centos 6 32bit / 64bit - NEW

hello,
this tutorial will show you how to install Dropbear Package On Centos 6 32bit and 64bit


32BIT 
=====
at first we have to download the dependencies bellow, ( you have to login using root access)
wget http://rpmfind.net/linux/epel/6/i386/libtommath-0.42.0-3.el6.i686.rpm
rpm -Uvh libtommath-0.42.0-3.el6.i686.rpm
wget http://rpmfind.net/linux/epel/6/i386/libtomcrypt-1.17-21.el6.i686.rpm
rpm -Uvh libtomcrypt-1.17-21.el6.i686.rpm
wget http://rpmfind.net/linux/epel/6/i386/dropbear-2014.63-1.el6.i686.rpm
rpm -Uvh dropbear*.rpm

64BIT
=====


wget http://rpmfind.net/linux/epel/6/x86_64/libtommath-0.42.0-3.el6.x86_64.rpm
rpm -Uvh libtommath-0.42.0-3.el6.x86_64.rpm
wget http://rpmfind.net/linux/epel/6/x86_64/libtomcrypt-1.17-21.el6.x86_64.rpm
rpm -Uvh libtomcrypt-1.17-21.el6.x86_64.rpm
wget http://rpmfind.net/linux/epel/6/x86_64/dropbear-2014.65-1.el6.x86_64.rpm
rpm -Uvh dropbear*.rpm
DONE !!!

HOW TO INSTALL WEBMIN ON CENTOS and DEBIAN - NEW SEPTEMBER 2014

WEBMIN  INSTALLATION  ON CENTOS VPS
==========================================
1. Login Using root access (get it from your VPS provider)
2. enter this script one by one


wget http://prdownloads.sourceforge.net/webadmin/webmin-1.700-1.noarch.rpm

rpm -Uvh webmin-1.700-1.noarch.rpm
----------------------------

Taraa your webmin is ready
please test it by entering hostvps:10000 

example :
123.23.12.1:10000

========================================
WEBMIN INSTALLATION ON DEBIAN VPS 
========================================
enter this script

wget http://prdownloads.sourceforge.net/webadmin/webmin_1.700_all.deb

and then entering :

dpkg --install webmin_1.700_all.deb

--------------------------------------------------
DONE !!!

if you failed and debian asking for dependencies, please enter :

apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python

IF YOU FAILED AGAIN PLEASE ENTER

apt-get update
apt-get -f install

NOTE : MOSTLY ON DEBIAN YOU SHOULD OPEN YOUR WEBMIN BY entering =

https://ipaddress:10000
========================DONE========================