├── Screenshot.png ├── LICENSE ├── README.md └── abdal-ocserv-mgr.sh /Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ebrasha/abdal-ocserv-mgr/HEAD/Screenshot.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Abdal Security Group 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Abdal OCSERV MGR 2 | ## 👀 Screenshot 3 |

4 | 5 | ## 💎 General purpose 6 | 7 | The best tool for managing an OpenConnect VPN server 8 | 9 | 10 | **Requires** 11 | > OCSERV (OpenConnect VPN Server) 12 | > Compatible with all Linux 13 | > 14 | ## 🛠️ Development Environment Setup 15 | - OcServ 16 | - Pure BashScript 17 | 18 | ## ✨ Features 19 | 20 | - Create a user 21 | - Change User Password 22 | - Lock user account 23 | - unlock user account 24 | - delete user account 25 | - Show All Users 26 | - Show connecting users 27 | - Disconnect the specified user 28 | - Prints the banned IP addresses 29 | - Unban the specified IP 30 | - Show Users Connection Software Type 31 | - Support Fedora - Debian - CentOS - Ubuntu - Red Hat 32 | 33 | ## 📝️ How it Works? 34 | ```bash 35 | git clone https://github.com/ebrasha/Abdal-OCSERV-MGR.git 36 | 37 | cd Abdal-OCSERV-MGR/ 38 | 39 | chmod +x abdal-ocserv-mgr.sh 40 | 41 | ./abdal-ocserv-mgr.sh 42 | ``` 43 | 44 | ## 🤵 Programmer 45 | Handcrafted with Passion by Ebrahim Shafiei (EbraSha) 46 | 47 | E-Mail = Prof.Shafiei@Gmail.com 48 | 49 | Telegram: https://t.me/ProfShafiei 50 | 51 | 52 | 53 | ## ☠️ Reporting Issues 54 | 55 | If you are facing a configuration issue or something is not working as you expected to be, please use the **Prof.Shafiei@Gmail.com** . Issues on GitLab or Github are also welcomed. 56 | 57 | -------------------------------------------------------------------------------- /abdal-ocserv-mgr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo -e " 3 | +-+-+-+-+-+ +-+-+-+-+-+-+ +-+-+-+ 4 | |A|b|d|a|l| |O|c|S|e|r|v| |M|G|R| 5 | +-+-+-+-+-+ +-+-+-+-+-+-+ +-+-+-+ 6 | Programmer : Ebrahim Shafiei (EbraSha) 7 | Email: Prof.Shafiei@Gmail.com 8 | " 9 | echo "Please select your action" 10 | echo "--1. Create a user" 11 | echo "--2. Change user pass" 12 | echo "--3. Lock user account" 13 | echo "--4. unlock user account" 14 | echo "--5. delete user account" 15 | echo "--6. Show All Users" 16 | echo "--7. Show connecting users" 17 | echo "--8. Disconnect the specified user" 18 | echo "--9. Prints the banned IP addresses" 19 | echo "--10. Unban the specified IP" 20 | echo "--11. Show Users Connection Software Type" 21 | read -r 22 | user_selection=$REPLY 23 | 24 | 25 | if [ $user_selection -eq "1" ] 26 | then 27 | echo "Please enter the user name" 28 | read -r 29 | user_name=$REPLY 30 | ocpasswd -c /etc/ocserv/ocpasswd $user_name 31 | echo "user created successfully" 32 | elif [ $user_selection -eq "2" ] 33 | then 34 | echo "Please enter the user name" 35 | read -r 36 | user_name=$REPLY 37 | ocpasswd -c /etc/ocserv/ocpasswd $user_name 38 | echo "password has been changed successfully" 39 | elif [ $user_selection -eq "3" ] 40 | then 41 | echo "Please enter the user name" 42 | read -r 43 | user_name=$REPLY 44 | ocpasswd -l -c /etc/ocserv/ocpasswd $user_name 45 | echo "user locked successfully" 46 | elif [ $user_selection -eq "4" ] 47 | then 48 | echo "Please enter the user name" 49 | read -r 50 | user_name=$REPLY 51 | ocpasswd -u -c /etc/ocserv/ocpasswd $user_name 52 | echo "user unlocked successfully" 53 | elif [ $user_selection -eq "5" ] 54 | then 55 | echo "Please enter the user name" 56 | read -r 57 | user_name=$REPLY 58 | ocpasswd -d -c /etc/ocserv/ocpasswd $user_name 59 | echo "user deleted successfully" 60 | elif [ $user_selection -eq "6" ] 61 | then 62 | clear 63 | echo "" 64 | echo "" 65 | echo "########################################################################" 66 | cat /etc/ocserv/ocpasswd 67 | echo "########################################################################" 68 | echo "" 69 | echo "" 70 | elif [ $user_selection -eq "7" ] 71 | then 72 | occtl show events 73 | echo "" 74 | elif [ $user_selection -eq "8" ] 75 | then 76 | echo "Please enter the user name" 77 | read -r 78 | user_name=$REPLY 79 | occtl disconnect user $user_name 80 | echo "" 81 | elif [ $user_selection -eq "9" ] 82 | then 83 | occtl show ip bans 84 | echo "" 85 | elif [ $user_selection -eq "10" ] 86 | then 87 | echo "Please enter the user IP address" 88 | read -r 89 | user_ip=$REPLY 90 | occtl unban ip $user_ip 91 | echo "" 92 | elif [ $user_selection -eq "11" ] 93 | then 94 | occtl show sessions all > /etc/ocserv/temp_ocserv 95 | user_connection_info_file="/etc/ocserv/temp_ocserv" 96 | while read line; do echo "---" $line | awk '{print $3, $6 ,$7}'; done < $user_connection_info_file 97 | rm -f /etc/ocserv/temp_ocserv 98 | echo "" 99 | else 100 | echo "You did not select the correct option" 101 | echo "" 102 | fi 103 | 104 | 105 | --------------------------------------------------------------------------------