- (Optional) Scrap off all the junk you won't need if it is a new box:
wget -O master.tar.gz http://github.com/maxexcloo/Minimal/tarball/master; tar zxvf *.gz; cd *Minimal*; sh minimal.sh ssh
If you are still using only root (have its benefits when you are just setting up your server), you will probably need to re-enable root login. Edit /etc/ssh/sshd_config and find:Replace it with:PermitRootLogin noSave the file, exit the editor, and restart your SSHd server:PermitRootLogin yes/etc/init.d/ssh restart - Install PPTPD:
apt-get install pptpd - Enable forwarding by editing /etc/sysctl.conf find:
Replace it with:
#net.ipv4.ip_forward=1Save the file, exit the editor, and apply the changes:net.ipv4.ip_forward=1sysctl -p - Towards the end of /etc/pptpd.conf, add, or uncomment these lines:
localip 10.84.1.1 remoteip 10.84.1.101-200 - Create your users by editing your /etc/ppp/chap-secrets file by adding it in the following format:
# Secrets for authentication using CHAP # client server secret IP addresses andy pptpd 1234 * john pptpd abcd * - Create a new file which will manage the routing with iptables firewall by creating /etc/init.d/vpnforward :
Make it executable:
#! /bin/sh case "$1" in start) iptables -A INPUT -p tcp --dport 1723 -j ACCEPT iptables -A INPUT -p 47 -j ACCEPT iptables -A FORWARD -i ppp+ -o vent0 -j ACCEPT iptables -t nat -A POSTROUTING -s 10.84.1.0/24 -j SNAT --to-source 185.45.192.1 echo "iptables entries for VPN forwarding added" ;; stop) echo "nothing to unload" ;; *) echo "Usage: /etc/init.d/vpnforward {start|stop}" exit 1 esac exit 0Add it to your boot sequence so you don't need to make the changes each time your VPS reboot:chmod a+x /etc/init.d/vpnforward*note: use this command if you want to remove it from auto-run at boot:update-rc.d vpnforward defaultsupdate-rc.d -f vpnforward remove - Edit /etc/ppp/pptpd-options with the following options:
name pptpd refuse-pap refuse-chap refuse-mschap require-mschap-v2 require-mppe-128 proxyarp lock nobsdcomp novj novjccomp nologfd ms-dns 8.8.8.8 ms-dns 8.8.4.4 - Everything should be set and good to go now, give it a try!
- 0 Users Found This Useful
