Water's Home

Just another Life Style

0%

How to Secure Tunnels to Localhost

Install Golang 1.4

tar -C /usr/local -xzf go1.4.3.linux-amd64.tar.gz
mkdir $HOME/go
echo ‘export GOROOT=/usr/local/go’>> ~/.bashrc
echo ‘export GOPATH=$HOME/go’>> ~/.bashrc
echo ‘export PATH=$PATH:$GOROOT/bin’>> ~/.bashrc
source /root/.bashrc

Install Git

yum install mercurial git bzr subversion -y

Install Ngrok

cd /usr/local/src/
git clone https://github.com/inconshreveable/ngrok.git

Generate CERT

export NGROK_DOMAIN=”www.qinuu.com"

cd ngrok/
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj “/CN=$NGROK_DOMAIN” -days 5000 -out rootCA.pem
openssl genrsa -out device.key 2048
openssl req -new -key device.key -subj “/CN=$NGROK_DOMAIN” -out device.csr
openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000

cp rootCA.pem assets/client/tls/ngrokroot.crt
cp device.crt assets/server/tls/snakeoil.crt
cp device.key assets/server/tls/snakeoil.key

Make Linux Server

GOOS=linux GOARCH=amd64
make release-server release-client

Make Windows Client

cd /usr/local/go/src
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 ./make.bash
cd /usr/local/src/ngrok/
GOOS=windows GOARCH=amd64 make release-server release-client

Start Ngrok Service

nohup bin/ngrokd -domain=”www.qinuu.com" -httpAddr=”:8080” -httpsAddr=”:8443” &

Download Windows Client

ls -al bin/windows_amd64/

Configure CLient CFG File

Start Windows Client