【Debian/L2TP】Ubuntu Or Debian L2TP一键安装脚本

#!/bin/bash if [ $(id -u) != "0" ]; then printf "Error: You must be root to run this tool!\n" exit 1 fi clear printf " #################################################### # # # This is a Shell-Based tool of l2tp installation # # Version: 1.3 # # Author: Linuxwang.com # # For Ubuntu 32bit and 64bit # # # #################################################### " vpsip=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk 'NR==1 { print $1}'` iprange="10.0.99" echo "Please input IP-Range:" read -p "(Default Range: 10.0.99):" iprange if [ "$iprange" = "" ]; then iprange="10.0.99" fi mypsk="vpsyou.com" echo "Please input PSK:" read -p "(Default PSK: vpsyou.com):" mypsk if [ "$mypsk" = "" ]; then mypsk="Linuxwang.com" fi clear get_char() { SAVEDSTTY=`stty -g` stty -echo stty cbreak dd if=/dev/tty bs=1 count=1 2> /dev/null stty -raw stty echo stty $SAVEDSTTY } echo "" echo "ServerIP:" echo "$vpsip" echo "" echo "Server Local IP:" echo "$iprange.1" echo "" echo "Client Remote IP Range:" echo "$iprange.2-$iprange.254" echo "" echo "PSK:" echo "$mypsk" echo "" echo "Press any key to start..." char=`get_char` clear apt-get -y update apt-get -y upgrade apt-get -y install libgmp3-dev bison flex libpcap-dev ppp iptables make gcc lsof vim mkdir /ztmp mkdir /ztmp/l2tp cd /ztmp/l2tp apt-get install openswan rm -rf /etc/ipsec.conf touch /etc/ipsec.conf cat >>/etc/ipsec.conf<<EOF config setup nat_traversal=yes virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12 oe=off protostack=netkey conn L2TP-PSK-NAT rightsubnet=vhost:%priv also=L2TP-PSK-noNAT conn L2TP-PSK-noNAT authby=secret pfs=no auto=add keyingtries=3 rekey=no ikelifetime=8h keylife=1h type=transport left=$vpsip leftprotoport=17/1701 right=%any rightprotoport=17/%any EOF cat >>/etc/ipsec.secrets<<EOF $vpsip %any: PSK "$mypsk" EOF sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf sed -i 's/#net.ipv6.conf.all.forwarding=1/net.ipv6.conf.all.forwarding=1/g' /etc/sysctl.conf sysctl -p iptables --table nat --append POSTROUTING --jump MASQUERADE for each in /proc/sys/net/ipv4/conf/* do echo 0 > $each/accept_redirects echo 0 > $each/send_redirects done /etc/init.d/ipsec restart ipsec verify cd /ztmp/l2tp wget http://downloads.sourceforge.net/project/rp-l2tp/rp-l2tp/0.4/rp-l2tp-0.4.tar.gz tar zxvf rp-l2tp-0.4.tar.gz cd rp-l2tp-0.4 ./configure make cp handlers/l2tp-control /usr/local/sbin/ mkdir /var/run/xl2tpd/ ln -s /usr/local/sbin/l2tp-control /var/run/xl2tpd/l2tp-control cd /ztmp/l2tp apt-get install xl2tpd mkdir /etc/xl2tpd rm -rf /etc/xl2tpd/xl2tpd.conf touch /etc/xl2tpd/xl2tpd.conf cat >>/etc/xl2tpd/xl2tpd.conf<<EOF [global] ipsec saref = yes [lns default] ip range = $iprange.2-$iprange.254 local ip = $iprange.1 refuse chap = yes refuse pap = yes require authentication = yes ppp debug = yes pppoptfile = /etc/ppp/options.xl2tpd length bit = yes EOF rm -rf /etc/ppp/options.xl2tpd touch /etc/ppp/options.xl2tpd cat >>/etc/ppp/options.xl2tpd<<EOF require-mschap-v2 ms-dns 8.8.8.8 ms-dns 8.8.4.4 asyncmap 0 auth crtscts lock hide-password modem debug name l2tpd proxyarp lcp-echo-interval 30 lcp-echo-failure 4 EOF cat >>/etc/ppp/chap-secrets<<EOF test l2tpd test123 * EOF touch /usr/bin/zl2tpset echo "#/bin/bash" >>/usr/bin/zl2tpset echo "for each in /proc/sys/net/ipv4/conf/*" >>/usr/bin/zl2tpset echo "do" >>/usr/bin/zl2tpset echo "echo 0 > \$each/accept_redirects" >>/usr/bin/zl2tpset echo "echo 0 > \$each/send_redirects" >>/usr/bin/zl2tpset echo "done" >>/usr/bin/zl2tpset chmod +x /usr/bin/zl2tpset iptables --table nat --append POSTROUTING --jump MASQUERADE zl2tpset xl2tpd cat >>/etc/rc.local<<EOF iptables --table nat --append POSTROUTING --jump MASQUERADE /etc/init.d/ipsec restart /usr/bin/zl2tpset /usr/local/sbin/xl2tpd EOF clear ipsec verify printf " #################################################### # # # This is a Shell-Based tool of l2tp installation # # Version: 1.3 # # Author: Linuxwang.com # # For Ubuntu 32bit and 64bit # # # #################################################### if there are no [FAILED] above, then you can connect to your L2TP VPN Server with the default user/pass below: ServerIP:$vpsip username:test password:test123 PSK:$mypsk "

【Linux/OwnCloud】Linux 安装 OwnCloud 1.8客户端

*此OwnCloud为客户端,并非服务端。

*服务端安装方法详见:【Linux/Ubuntu/OwnCloud】Linux中安装OwnCloud 7.0.4 文章。

更新日志(未翻译):

  • Support Sharing from desktop: Added a share dialog that can be opened by context menu in the file managers (Win, Mac, Nautilus). It supports public links with password enforcement
  • Enhanced usage of parallel HTTP requests for ownCloud 8 servers
  • Renamed github repository from mirall to client.
  • Mac OS: Use native notification support
  • Selective Sync: allow to enforce selective sync in brandings.
  • Added ability to build on Windows utilizing MingGW
  • SQLite database fixes if running on FAT filesystems
  • Improved detection of changing files to upload from local
  • Preparations for the multi-account feature
  • Fixed experience for Window manager without system tray
  • Build with Qt 5.4
  • Dropped libneon dependency if Qt 5.4 is available
  • Keep files open very short, that avoid lock problems on Windows especially with office software but also others.
  • Merged some NetBSD patches
  • Selective sync support for owncloudcmd
  • Reorganize the source repository
  • Prepared direct download
  • Added Crashreporter feature to be switched on on demand
  • A huge amount of bug fixes in all areas of the client.
  • almost 700 commits since 1.7.1

可以在以下系统中安装:

  • Ubuntu 14.10 Utopic Unicorn
  • Ubuntu 14.04 Trusty Tahr
  • Ubuntu 12.04 Precise Pangolin
  • Linux Mint 17.1 Rebecca
  • Linux Mint 17 Qiana
  • Linux Mint 13 Maya
  • Pinguy OS 14.04
  • Elementary OS 0.3 Freya
  • Elementary OS 0.2 Luna
  • Deepin 2014
  • Peppermint Five
  • LXLE 14.04
  • Linux Lite 2.0
  • Debian Wheezy
  • Fedora 21
  • Fedora 20
  • CentOS 7
  • CentOS 6
  • OpenSUSE 13.2
  • OpenSUSE 13.1
  • OpenSUSE 12.3

Ubuntu 14.10安装方法:

$ echo "deb http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.10/ /" | sudo tee /etc/apt/sources.list.d/owncloud.list $ cd /tmp $ wget http://download.opensuse.org/repositories/isv:ownCloud:desktop/xUbuntu_14.10/Release.key $ apt-key add - < Release.key $ sudo apt-get update $ sudo apt-get install owncloud-client ...