Advertisement
patryk

VPN connection

Aug 25th, 2014
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.09 KB | None | 0 0
  1.  
  2. # SKRYPT STARTOWY INSTALOWANY NA KAŻDYM URZĄDZENIU RASPBERRY PI
  3. # - Dodaje nowego użytkownika do systemu
  4. # - Instaluje klienta VPN, na podstawie danych nowego użytkownika
  5.  
  6. more welcome.txt #EKRAN POWITALNY
  7. pass=0
  8. repass=1
  9.  
  10. echo -n "Podaj nazwę użytkownika: "
  11. read username
  12.  
  13. while [ "$pass" != "$repass" ]; do
  14.   echo -n "Podaj hasło: "
  15.   read -s pass
  16.  
  17.   echo -n -e "\nPowtórz hasło: "
  18.   read -s repass
  19.  
  20.   if [ "$pass" != "$repass" ]; then
  21.     echo -e "\n**Hasła się różnią!\n"
  22.   fi
  23. done
  24.  
  25. #Adding new user to the system
  26. useradd --password "$pass" "$username"
  27.  
  28. #Installing PPTP Client
  29. yum -y install pptp
  30.  
  31. #Adding Kernel module
  32. modprobe ppp_mppe
  33.  
  34. #Creating new file /etc/ppp/peers/pptpserver
  35. touch /etc/ppp/peers/pptpserver
  36. echo "pty \"pptp [no_ip_4_u_pastebin_diggers_:)] --nolaunchpppd\"
  37. name $username
  38. password $pass
  39. remotename PPTP
  40. require-mppe-128" > /etc/ppp/peers/pptpserver
  41.  
  42. #Calling PPTP Server
  43. pppd call pptpserver
  44.  
  45. #Setup routing to you private network via ppp0
  46. ip route add 10.0.0.0/8 dev ppp0
  47.  
  48. ifconfig ppp0
  49. echo -e "\nInstalacja zakończona!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement