CentOS 6、7下pptp vpn一鍵安裝指令碼
- #!/bin/bash
- #
- # Author: yeho <lj2007331 AT gmail.com>
- # Blog: //blog.linuxeye.com
- #
- # Installs a PPTP VPN-only system for CentOS
- # Check if user is root
- [ $(id -u) != "0" ] && { echo -e "\033[31mError: You must be root to run this script\033[0m"; exit 1; }
- export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
- clear
- printf "
- #######################################################################
- # LNMP/LAMP/LANMP for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+ #
- # Installs a PPTP VPN-only system for CentOS #
- # For more information please visit //blog.linuxeye.com/31.html #
- #######################################################################
- "
- [ ! -e '/usr/bin/curl' ] && yum -y install curl
- VPN_IP=`curl ipv4.icanhazip.com`
- VPN_USER="linuxeye"
- VPN_PASS="linuxeye"
- VPN_LOCAL="192.168.0.150"
- VPN_REMOTE="192.168.0.151-200"
- while :; do echo
- read -p "Please input username: " VPN_USER
- [ -n "$VPN_USER" ] && break
- done
- while :; do echo
- read -p "Please input password: " VPN_PASS
- [ -n "$VPN_PASS" ] && break
- done
- clear
- if [ -f /etc/redhat-release -a -n "`grep ' 7\.' /etc/redhat-release`" ];then
- #CentOS_REL=7
- if [ ! -e /etc/yum.repos.d/epel.repo ];then
- cat > /etc/yum.repos.d/epel.repo << EOF
- [epel]
- name=Extra Packages for Enterprise Linux 7 - \$basearch
- #baseurl=http://download.fedoraproject.org/pub/epel/7/\$basearch
- mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=\$basearch
- failovermethod=priority
- enabled=1
- gpgcheck=0
- EOF
- fi
- for Package in wget make openssl gcc-c++ ppp pptpd iptables iptables-services
- do
- yum -y install $Package
- done
- echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf
- elif [ -f /etc/redhat-release -a -n "`grep ' 6\.' /etc/redhat-release`" ];then
- #CentOS_REL=6
- for Package in wget make openssl gcc-c++ iptables ppp
- do
- yum -y install $Package
- done
- sed -i '[email protected]_forward.*@net.ipv4.ip_forward = 1@g' /etc/sysctl.conf
- rpm -Uvh http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm
- yum -y install pptpd
- else
- echo -e "\033[31mDoes not support this OS, Please contact the author! \033[0m"
- exit 1
- fi
- echo "1" > /proc/sys/net/ipv4/ip_forward
- sysctl -p /etc/sysctl.conf
- [ -z "`grep '^localip' /etc/pptpd.conf`" ] && echo "localip $VPN_LOCAL" >> /etc/pptpd.conf # Local IP address of your VPN server
- [ -z "`grep '^remoteip' /etc/pptpd.conf`" ] && echo "remoteip $VPN_REMOTE" >> /etc/pptpd.conf # Scope for your home network
- if [ -z "`grep '^ms-dns' /etc/ppp/options.pptpd`" ];then
- cat >> /etc/ppp/options.pptpd << EOF
- ms-dns 223.5.5.5 # Aliyun DNS Primary
- ms-dns 114.114.114.114 # 114 DNS Primary
- ms-dns 8.8.8.8 # Google DNS Primary
- ms-dns 209.244.0.3 # Level3 Primary
- ms-dns 208.67.222.222 # OpenDNS Primary
- EOF
- fi
- echo "$VPN_USER pptpd $VPN_PASS *" >> /etc/ppp/chap-secrets
- ETH=`route | grep default | awk '{print $NF}'`
- [ -z "`grep '1723 -j ACCEPT' /etc/sysconfig/iptables`" ] && iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 1723 -j ACCEPT
- [ -z "`grep 'gre -j ACCEPT' /etc/sysconfig/iptables`" ] && iptables -I INPUT 5 -p gre -j ACCEPT
- iptables -t nat -A POSTROUTING -o $ETH -j MASQUERADE
- iptables -I FORWARD -p tcp --syn -i ppp+ -j TCPMSS --set-mss 1356
- service iptables save
- sed -i '[email protected]^-A INPUT -j REJECT --reject-with [email protected]#-A INPUT -j REJECT --reject-with [email protected]' /etc/sysconfig/iptables
- sed -i '[email protected]^-A FORWARD -j REJECT --reject-with [email protected]#-A FORWARD -j REJECT --reject-with [email protected]' /etc/sysconfig/iptables
- service iptables restart
- chkconfig iptables on
- service pptpd restart
- chkconfig pptpd on
- clear
- echo -e "You can now connect to your VPN via your external IP \033[32m${VPN_IP}\033[0m"
- echo -e "Username: \033[32m${VPN_USER}\033[0m"
- echo -e "Password: \033[32m${VPN_PASS}\033[0m"
相關推薦
CentOS 6、7下pptp vpn一鍵安裝指令碼
#!/bin/bash # # Author: yeho <lj2007331 AT gmail.com> # Blog: //blog.linuxeye.com # # Installs a PPTP VPN-only system for CentOS # Check if user i
CentOS 6、7下pptp vpn一鍵安裝指令碼(轉)
這個指令碼可以單獨使用,直接複製或下載執行即可,不用依賴安裝包的其它指令碼。 CentOS 6、7下pptp vpn一鍵安裝指令碼,安裝如下: 1. wget http://mirrors.linuxeye.com/scripts/vpn_centos.sh
Centos7搭建pptp VPN一鍵安裝指令碼
Centos7搭建pptp一鍵安裝指令碼 使用: wget https://raw.githubusercontent.com/DanylZhang/VPS/master/CentOS7-pptp-host1plus.sh chmod +x ./Ce
Centos7搭建pptp VPN一鍵安裝腳本
sdn bsp 長度 登錄 title 無法 att -s 其他 Centos7搭建pptp一鍵安裝腳本 廢話不多說,先上腳本地址:Centos7一鍵pptp 使用: wget https://raw.githubusercontent.com/DanylZhang/
Mysql 5.6,5.7 基於shell 的一鍵安裝
參考文件:https://dev.mysql.com/doc/refman/5.7/en/binary-installation.html 、https://dev.mysql.com/doc/refman/5.6/en/binary-installation.html 環境要求: src
centos6.4安裝搭建pptp vpn服務(附pptp vpn 一鍵安裝包)
今天在vps上裝pptp ,和以往一樣,只不過不是在自己的vps上,上次ssh代理被封ip,對我的身心造成了深深的影響,所以,這次拿網友放我這的vps來搭建vpn環境。pptp的搭建比openvpn容易多了。以下是我的配置過程,其實和網上差不多,centos6.4 搭建 centos 6.4 搭建p
基於CentOS7的PPTP VPN一鍵部署指令碼
指令碼已親測可用,環境是centos7.4 #!/bin/bash [ $(id -u) != "0" ] && { echo "Error: You must be root to run this script"; exit 1; } e
CentOS下shadowsocks-libev一鍵安裝指令碼
本指令碼適用環境: 系統支援:CentOS 記憶體要求:≥128M 日期:2017 年 02 月 24 日 關於本指令碼: 一鍵安裝 libev 版的 Shadowsocks 最新版本。該版本的特點是記憶體佔用小(600k左右),低 CPU 消耗,
Centos 6/7 x86_64 系統開啟TCP-BBR擁塞控制一鍵安裝指令碼
核心特點 1、使用自編譯好的核心; 2、無需手動修改grub啟動項; 3、已經預設設定擁塞演算法為BBR,無需額外設定,重啟即可用 指令碼一鍵安裝 wget -O- https://soft.alphabrock.cn/Linux/scripts/bbr
CentOS-6.9下搭建FastDFS(文章最後有一鍵安裝指令碼)
1.所需安裝包 libfastcommon-master.zip FastDFS_v5.05.tar.gz fastdfs-nginx-module_v1.16.tar.gz nginx-1.8.0.tar.gz 2.安裝libfastcommon
Centos下使用yum一鍵安裝redis
1.虛擬機器安裝好了之後,rpm -qa | grep redis 2.發現沒有redis 3.dhclient 自動連線分配網路 4.使用yum源搜尋redis yum serach redis,發現沒有安裝源 5.安裝軟體包的源 yum ins
Ubuntu安裝vpn pptp一鍵安裝指令碼
一鍵安裝方法: wget http://www.ilucong.net/file/pptp-debian.sh && sh pptp-debian.sh 坐等安裝,完後會給出預設使用者名稱和密碼。 隨後軟體自動配置vpn,在最後會給出預設的vpn使用者名稱
【環境】虛擬環境下模塊一鍵安裝方式
軟件 2.6 模塊 log lin class 3.0 們的 req 安裝依賴包(須在虛擬環境中): 依賴就是開發以及程序運行需要使用的環境的集合。包括軟件、插件等。我們一般會把需要使用的依賴給保存在一個文件中,命名為requirements的txt文件。如果在其它環境中要
MySQL5.7一鍵安裝指令碼
本文寫作說明:MySQL的配置檔案my.cnf引數調整參考來源於iMySQL | 老葉茶館此指令碼是本博主生產環境中經常使用的進行批量部署mysql服務時採用。指令碼比較陋,寫此處主要是方便自己使用時及時查閱,同時也希望可以幫助初級的DBA同學,指令碼中如有寫法不當之處歡迎拍磚,但是也希望不喜勿噴。 指令碼
linux 下mysql一鍵安裝指令碼
修改名字為 mysql.sh #!/bin/bash GROUP_NAME=mysql USER_NAME=mysql MYSQLDB_HOME=/home/mysql/mysql MYSQLDB_DATA_HOME=/home/mys
linux下go環境一鍵安裝配置
go語言我就不做介紹了,對於剛開始想使用的小白來說,環境的安裝和配置雖然不是很難,但是總得各種查資料才能搞定,所以我就整理了一個linux下一鍵安裝的工具,方便大家使用。需要下載的資料: 重要的事情說三遍,好了,主要說下里面的install.sh,
PPTP 一鍵安裝指令碼
#!/bin/bash function installVPN(){ echo "begin to install VPN services"; #check wether vps suppot ppp and tun yum remove -y pptpd p
Red5一鍵安裝指令碼(Linux&Win):一鍵搭建你的直播平臺
Red5一鍵部署script(Linux&Win):一鍵搭建你的直播平臺 看到bilibili,熊貓TV,鬥魚TV等直播平臺你是不是也很眼紅呢,這裡站長為大夥寫了一個Red5一鍵部署script。 Red5供給基於Flash的流媒體服務的一款基於Java的開源流媒體伺服器。它由Java言語編寫,使
VPS網路優化各種方法彙總——銳速-BBR-BBR魔改版一鍵安裝指令碼
雲主機網路優化各類方式彙總——銳速/BBR/BBR改裝版一鍵部署script 大夥的大有些雲主機都是放在海外的,在海外的伺服器上由於受各類要素影響,就算海外的伺服器都是百兆同享或者G口到大陸下載速率都不是很讓人滿足,而大有些的friend們都用的低廉Linux
VDVESTA一鍵安裝指令碼-VESTACP-PHP7.1-檔案管理器-vDDoSProxy
VDVESTA一鍵部署script/VESTACP/PHP7.1/檔案管理器/vDDoS Proxy 簡介 VDVESTA是一個小型的shellscript,為您的CentOS7 x86_64主動定製並部署VESTACP面板,與官方面板不同的是,此script支援php7。並增加了需付費使用的檔案管理面板