add-ssh.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. red='\e[1;31m'
  3. green='\e[0;32m'
  4. NC='\e[0m'
  5. MYIP=$(wget -qO- https://icanhazip.com);
  6. echo "Checking VPS"
  7. clear
  8. read -p "Username : " Login
  9. read -p "Password : " Pass
  10. read -p "Expired (hari): " masaaktif
  11. IP=$(wget -qO- https://icanhazip.com);
  12. if [[ "$domain" = "" ]]; then
  13. domain=$(cat /home/domain)
  14. else
  15. domain=$IP
  16. fi
  17. ssl="$(cat ~/log-install.txt | grep -w "Stunnel4" | cut -d: -f2)"
  18. sqd="$(cat ~/log-install.txt | grep -w "Squid" | cut -d: -f2)"
  19. ovpn="$(netstat -nlpt | grep -i openvpn | grep -i 0.0.0.0 | awk '{print $4}' | cut -d: -f2)"
  20. ovpn2="$(netstat -nlpu | grep -i openvpn | grep -i 0.0.0.0 | awk '{print $4}' | cut -d: -f2)"
  21. sleep 1
  22. echo Ping Host
  23. echo Cek Hak Akses...
  24. sleep 0.5
  25. echo Permission Accepted
  26. clear
  27. sleep 0.5
  28. echo Membuat Akun: $Login
  29. sleep 0.5
  30. echo Setting Password: $Pass
  31. sleep 0.5
  32. clear
  33. useradd -e `date -d "$masaaktif days" +"%Y-%m-%d"` -s /bin/false -M $Login
  34. exp="$(chage -l $Login | grep "Account expires" | awk -F": " '{print $2}')"
  35. echo -e "$Pass\n$Pass\n"|passwd $Login &> /dev/null
  36. echo -e ""
  37. echo -e "=================================="
  38. echo -e "Information SSH & OpenVPN Account "
  39. echo -e "=================================="
  40. echo -e "Domain : $domain"
  41. echo -e "Host : $IP"
  42. echo -e "Username : $Login "
  43. echo -e "Password : $Pass"
  44. echo -e "=================================="
  45. echo -e "OpenSSH : 22"
  46. echo -e "Dropbear : 109, 143"
  47. echo -e "SSL/TLS : $ssl"
  48. echo -e "Port Squid : $sqd"
  49. echo -e "OpenVPN : TCP $ovpn"
  50. echo -e "http://$IP:81/client-tcp-$ovpn.ovpn"
  51. echo -e "OpenVPN : UDP $ovpn2"
  52. echo -e "http://$IP:81/client-udp-$ovpn2.ovpn"
  53. echo -e "OpenVPN : SSL 442"
  54. echo -e "http://$IP:81/client-tcp-ssl.ovpn"
  55. echo -e "OpenVPN : OHP 8087"
  56. echo -e "http://$MYIP:81/tcp-ohp.ovpn"
  57. echo -e "badvpn : 7100, 7200, 7300"
  58. echo -e "=================================="
  59. echo -e "Expired On : $exp"
  60. echo -e "Created By EvoTeamMalaysia"
  61. echo -e ""