GithubHelp home page GithubHelp logo

installstunnel's Introduction

CARA INSTALL STUNNEL SSH SSL/TLS DI UBUNTU & DEBIAN UNTUK KPN REVOLUTION

Tutorial by Galih Prastowo Aji

1. Install dropbear dulu

Di terminal ketik:

apt-get update
apt-get upgrade
apt-get install -y dropbear
nano /etc/default/dropbear

Isi sebagai berikut:

# disabled because OpenSSH is installed
# change to NO_START=0 to enable Dropbear
NO_START=0

# the TCP port that Dropbear listens on
DROPBEAR_PORT=3128

# any additional arguments for Dropbear
DROPBEAR_EXTRA_ARGS=

# specify an optional banner file containing a message to be
# sent to clients before they connect, such as "/etc/issue.net"
DROPBEAR_BANNER=

# RSA hostkey file (default: /etc/dropbear/dropbear_rsa_host_key)
#DROPBEAR_RSAKEY="/etc/dropbear/dropbear_rsa_host_key"

# DSS hostkey file (default: /etc/dropbear/dropbear_dss_host_key)
#DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key"

# Receive window size - this is a tradeoff between memory and
# network performance
DROPBEAR_RECEIVE_WINDOW=65536

Lalu jalankan dropbear:

/etc/init.d/dropbear start

1. Install stunnel

Di terminal ketik:

apt-get update
apt-get install -y stunnel4

Sekarang buat konfigurasi stunnel:

nano /etc/stunnel/stunnel.conf

Isi sebagai berikut:

cert = /etc/stunnel/stunnel.pem
client = no
socket = a:SO_REUSEADDR=1
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1

[dropbear]
connect = 127.0.0.1:3128
accept = 443

Sekarang kita buat sertifikat SSL. PERHATIAN: Copy command dibawah ini satu - satu, jangan di copy & paste 3 commands sekaligus.

openssl genrsa -out key.pem 2048
openssl req -new -x509 -key key.pem -out cert.pem -days 1095
cat key.pem cert.pem >> /etc/stunnel/stunnel.pem

Sekarang kita buat stunnel jalan secara otomatis ketika VPS di reboot:

nano /etc/default/stunnel4

Isi sebagai berikut:

# /etc/default/stunnel
# Julien LEMOINE <[email protected]>
# September 2003

# Change to one to enable stunnel automatic startup
ENABLED=1
FILES="/etc/stunnel/*.conf"
OPTIONS=""

# Change to one to enable ppp restart scripts
PPP_RESTART=0

Sekarang start stunnel di VPS kita:

/etc/init.d/stunnel4 start

Untuk mengecek apakah stunnel & dropbear berjalan normal di VPS, kita bisa menggunakan command:

netstat -nlpt

Maka hasilnya akan seperti ini jika keduanya berjalan normal:

root@NewDeb:~# netstat -nlpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      2554/stunnel4   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2123/sshd       
tcp        0      0 0.0.0.0:3128            0.0.0.0:*               LISTEN      2708/dropbear   
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2362/exim4      
tcp6       0      0 :::22                   :::*                    LISTEN      2123/sshd       
tcp6       0      0 :::3128                 :::*                    LISTEN      2708/dropbear   
tcp6       0      0 ::1:25                  :::*                    LISTEN      2362/exim4

3. Sekarang kita coba konek SSH pakai stunnel di KPN Revolution

Kita buat akun dulu di VPS kita

useradd test
passwd test

Di KPN Revolution isikan akun SSH sebagai berikut:

Host: IP VPS KITA
Username: test
Password: test
SSL/SSH Port: 443

installstunnel's People

Contributors

hillz2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.