Advertisement
Guest User

Untitled

a guest
May 27th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #!/bin/bash
  2. #Script auto create trial user SSH
  3.  
  4. read -p "Username : " Login
  5. read -p "Password : " Pass
  6. read -p "Expired (hari): " masaaktif
  7.  
  8. IP=`dig +short myip.opendns.com @resolver1.opendns.com`
  9. useradd -e `date -d "$masaaktif days" +"%Y-%m-%d"` -s /bin/false -M $Login
  10. exp="$(chage -l $Login | grep "Account expires" | awk -F": " '{print $2}')"
  11. echo -e "$Pass\n$Pass\n"|passwd $Login &> /dev/null
  12. echo -e ""
  13. echo -e "Informasi SSH"
  14. echo -e "=========-account-=========="
  15. echo -e "Host: $IP"
  16. echo -e "Port: 443,143,80"
  17. echo -e "Username: $Login "
  18. echo -e "Password: $Pass"
  19. echo -e "-----------------------------"
  20. echo -e "Aktif Sampai: $exp"
  21. echo -e "==========================="
  22. echo -e "Script by \e[1;33;44mKZN\e[0m"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement