usernew.sh 886 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. #Script auto create user SSH
  3. read -p "Username : " Login
  4. read -p "Password : " Pass
  5. read -p "Expired (day): " Activetime
  6. IP=`dig +short myip.opendns.com @resolver1.opendns.com`
  7. useradd -e `date -d "$Activetime days" +"%Y-%m-%d"` -s /bin/false -M $Login
  8. exp="$(chage -l $Login | grep "Account expires" | awk -F": " '{print $2}')"
  9. echo -e "$Pass\n$Pass\n"|passwd $Login &> /dev/null
  10. echo -e ""
  11. echo -e "====SSH Account Information====" | lolcat
  12. echo -e "Host: $IP"
  13. echo -e "Username: $Login "
  14. echo -e "Password: $Pass"
  15. echo -e "Port OpenSSH: 22,444"
  16. echo -e "Port Dropbear: 143,3128"
  17. echo -e "Port SSL: 443"
  18. echo -e "Port Squid: 8000,8080"
  19. echo -e "Config OpenVPN (TCP 1194): http://$IP:81/client.ovpn"
  20. echo -e "-----------------------------" | lolcat
  21. echo -e "Expiration: $exp"
  22. echo -e "=============================" | lolcat
  23. echo -e "Mod by Janda Baper Group"
  24. echo -e ""