mandag 13. juli 2015

Basic installation script - Softether VPN server\bridge on Raspberry pi 2

The easiest way to do a installation of softether VPN on a RPi is to use the script on this page.
Note that this script will make both the VPN server and bridge installations, but it will only install the VPN server instance. You will need to change the script to enable a VPN bridge deamon.
You should never run a VPN server and VPN bridge at the same time.
The procedure is pretty easy.

Copy the code from this page (select all the code using the mouse, and then copy it Ctrl+C)
then connect to your RPi using putty (or ssh) and log on with the pi user.

Create an empty file:

Click  the letter" i" on your keyboard (the vim will show *insert* mode)
right click in putty and the copied code will paste inside
Now click the "Esc" button on your keyboard
then click ":wq" in vim and then enter button
The file is now saved.

To make the file executable enter the following
chmod 777
and then run the file:

This video show the full running of the script:

#! /bin/bash
sudo apt-get update
sudo apt-get dist-upgrade -y
#Download daemon scripts

# Remove uneeded applications from Raspian

sudo apt-get remove --purge  wolfram-engine penguinspuzzle scratch dillo squeak-vm squeak-plugins-scratch sonic-pi idle idle3 netsurf-gtk netsurf-common -y
sudo apt-get clean
sudo rm -rf /home/pi/python_games
sudo rm -rf /opt/vc

# Optional X server remove (800 MB)

sudo apt-get --purge remove gnome-* lxde* lightdm* xserver* desktop-* python* smbclient lxappearance lxinput lxmenu-data lxpanel lxpolkit lxrandr lxsession lxsession-edit lxshortcut lxtask lxterminal leafpad menu menu-xdg xpdf xkb-data xinit xfonts-utils xfonts-encodings xdg-utils xauth xarchiver x11-utils x11-common -y
sudo apt-get autoremove

# Install Applications

sudo apt-get install vim git-core ufw moreutils lsof build-essential curl hostapd  bridge-utils -y

# Install optional PI firmware

# sudo apt-get install rpi-update -y
# sudo rpi-update

#Disable DNS lookup SSH

sudo echo useDNS no > /etc/ssh/sshd_config

# Download Files - Check current versions and change accordingly in DownloadURLS

curl $DOWNLOADURLServer -s | sudo tar xzvf - -C /usr/local/
curl $DOWNLOADURLBridge -s | sudo tar xzvf - -C /usr/local/
#curl $DOWNLOADURLclient -s | sudo tar xzvf - -C /usr/local/
pushd .
cd /usr/local/vpnserver
echo "1
" | sudo make
pushd .
cd /usr/local/vpnbridge
echo "1
" | sudo make

sudo chmod 755 /usr/local/vpnserver

sudo chmod 600 /usr/local/vpnserver/*
sudo chmod 700 /usr/local/vpnserver/vpncmd
sudo chmod 700 /usr/local/vpnserver/vpnserver

sudo chmod 755 /usr/local/vpnbridge

sudo chmod 600 /usr/local/vpnbridge/*
sudo chmod 700 /usr/local/vpnbridge/vpncmd
sudo chmod 700 /usr/local/vpnbridge/vpnbridge

sudo mkdir /var/lock/subsys

sudo mv vpnserver /etc/init.d/vpnserver

sudo mv vpnbridge /etc/init.d/vpnbridge
sudo chmod 755 /etc/init.d/vpnbridge
sudo chmod 755 /etc/init.d/vpnserver

# Uncomment either the vpnserver or bridge line depending on which of the servers you want to run

sudo update-rc.d vpnserver defaults
# sudo update-rc.d vpnbridge defaults

sudo reboot

1 kommentar:

  1. How to update to newest version on Raspberry Pi?