{"id":13587350,"url":"https://github.com/Tontonjo/proxmox_toolbox","last_synced_at":"2025-04-07T21:33:37.493Z","repository":{"id":38071560,"uuid":"372762890","full_name":"Tontonjo/proxmox_toolbox","owner":"Tontonjo","description":"A toolbox to get the firsts configurations of Proxmox VE / BS done in no time","archived":false,"fork":false,"pushed_at":"2024-01-24T20:25:34.000Z","size":511,"stargazers_count":232,"open_issues_count":0,"forks_count":37,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-02-14T21:49:00.217Z","etag":null,"topics":["backup","notifications","pbs","proxmox","pve","restore","security","security-tools","smart","snmp","swap","update"],"latest_commit_sha":null,"homepage":"https://www.youtube.com/c/tontonjo","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tontonjo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-01T08:50:38.000Z","updated_at":"2024-06-18T06:40:17.975Z","dependencies_parsed_at":"2023-10-01T22:30:55.426Z","dependency_job_id":"2b7aa914-dc99-48de-a9ac-87b2b0da753a","html_url":"https://github.com/Tontonjo/proxmox_toolbox","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tontonjo%2Fproxmox_toolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tontonjo%2Fproxmox_toolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tontonjo%2Fproxmox_toolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tontonjo%2Fproxmox_toolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tontonjo","download_url":"https://codeload.github.com/Tontonjo/proxmox_toolbox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247732875,"owners_count":20986945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","notifications","pbs","proxmox","pve","restore","security","security-tools","smart","snmp","swap","update"],"created_at":"2024-08-01T15:06:10.232Z","updated_at":"2025-04-07T21:33:37.481Z","avatar_url":"https://github.com/Tontonjo.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Proxmox Toolbox  \n## Toolbox to setup Proxmox Virtual Environment and Backup Server\n\n![image](https://github.com/Tontonjo/proxmox_toolbox/assets/60965766/dc7f1493-0d29-4a7a-b84e-f1e61dcc7ffc)\n\n\n## Tonton Jo  \n### Rejoint la trame - Join the community \u0026 Support my work   \n[Click Here!](https://linktr.ee/tontonjo)  \n\n## Informations:\n\nThis little tool aim to get smalls one-time configurations for Proxmox Virtual environement and backup server hosts in no time.  \nIt automatically will find if the host is a pve or a pbs host and setup accordingly.  \n\n### Demonstration:  \nYou can watch a demonstration of the tool [in this playlist](https://www.youtube.com/playlist?list=PLU73OWQhDzsTpLpVNspJ14rVrXAmo2Biu) \n\n### Prerequisits:\n- Up-to-date PVE 7 / 8 or PBS server\n- Internet connexion\n\n## Features are:\n- Automatic PVE / PBS host detection\n- Hide enterprise repo and set no-subscription repository\n-  -  when no-enterprise source is set, disable no-subscription message\n- Update host and create a new command \"proxmox-update\"\n- Install usefull dependencies: ifupdown2 - git - sudo - libsasl2-modules - snmp\n- Security settings:\n- - Enable fail2ban with default configuration for sshd, Proxmox virtual environement and Proxmox backup server  \n(credits to [inettgmbh](https://github.com/inettgmbh/fail2ban-proxmox-backup-server))  \n- - Create another debian user with sudo rights\n- - Disable root ssh login\n- - Create another Proxmox GUI administrator (login with Proxmox VE Realm)\n- - Disabling root@pam user !!! root@pam is needed to update from GUI - update can still be done trough SSH if disabled !!!\n- SWAP value change or disable \n- Enable S.M.A.R.T self-tests on all supported drives\n- - short: every sunday@22h - Long: every 1st of month @22h\n- Enable SNMP V2 or v3\n- Backup and restore Proxmox Virtual Environment and Backup Server configurations\n- - Automatic remount of directories and zpools using previously existing configurations\n- - Please find more informations below  \n\n## Legacy hidden function:\n- Configure email service to send system and proxmox notifications (postfix)\n\n## News  \n2023.11.24: Proxmox 8.1 - Emails Notifications - Proxmox VE now supports email configurations very well from the GUI, the toolbox wont get any update related to this function anymore.  \n\n## Usage and arguments:\n###  Get and execute:  \n```shell\nwget -qO proxmox_toolbox.sh https://raw.githubusercontent.com/Tontonjo/proxmox_toolbox/main/proxmox_toolbox.sh \u0026\u0026 bash proxmox_toolbox.sh\n```\n\n### Updating host \u0026 remove subscription message\nThe script will update your host and detect if the no-enterprise source is configured, if so, remove the subscription message.\n- If you still encounter it after, clear your broswer cache.\n- If you update your host directly within the system, the no subscribtion message may reappear when the file gets updated.  \n- In order to nerver see this again, you have to update Proxmox with one of the following options:\n\nTo start an update only, without menu or prompt:\n```shell\nbash proxmox_toolbox.sh -u\n```\nOnce the tool has been used to update host, you can execute this command to fully update your host - kind of an alias of bash proxmox_toolbox.sh -u\n```shell\nproxmox-update\n```\n\n### Backup configuration  \nTo start a configuration backup only:\n```shell\nbash proxmox_toolbox.sh -b\n```  \n## Fail2ban:  \nIf you enable fail2ban, i guess you know what you're doing, if you dont: here's some usefull informations and commands:  \n- ban are for 1 hour\n- ssh and web interface logins are monitored  \n#### List of $jailname:\n```ssh\nfail2ban-client status\n```\n#### get status of a jails - display banned IP's\n```ssh\nfail2ban-client status $jailname\n```\n#### Unband an IP:\n```ssh\nfail2ban-client set $jailname unbanip  $ipaddress\n```\n\n\n## Backup and Restoration:  \n- Be carefull as this was not extensively tested - especially not with cluster configurations\n- The following folders and configurations are backuped by default:  \n```/etc/ssh/sshd_config /root/.ssh/ /etc/fail2ban/ /etc/systemd/system/*.mount /etc/network/interfaces /etc/sysctl.conf /etc/resolv.conf /etc/hosts /etc/hostname /etc/cron* /etc/aliases /etc/snmp/ /etc/smartd.conf /usr/share/snmp/snmpd.conf /etc/postfix/ /etc/pve/ /etc/lvm/ /etc/modprobe.d/ /var/lib/pve-firewall/ /var/lib/pve-cluster/  /etc/vzdump.conf /etc/ksmtuned.conf /etc/proxmox-backup/```  \n\n### Backup\nThe script will put every folder listed in backup_content in a tar.gz archive.  \n- You cand add /remove folder trough the edit of backup_content= line in the script\n- You can change the target folder to use for backup and restoration in the script env. variables at: backupdir=\"/root/\"\n\nOnce the backup is done, a tar.gz archive is located at backupdir=\"/root/\".  \n\n### Restauration:  \nThe script looks for tar.gz files located in backupdir=\"/root/\" and will list all the available archives for you to choose one.  \nWarning: The restauration will overwrite any existing file with the one in archive  \n\nThe restauration process will:\n- Reinstall missing dependencies for snmp and fail2ban if config were existing  \n- Restore Proxmox configurations (proxmox configs, certificates, vm configs, storages configs, proxmox users)\n- Automatically remount the following storages: dir and zpools\n\n## Directory mountpoint and zpool\n\nIn case of need, here's how you can manually mount storages:\n\n#### Directory:\nMount configurations are located in /etc/systemd/system/mnt-datastore-$datastorename.mount  \n- run the following commands:  \n```shell\nsource /etc/systemd/system/mnt-datastore-$datastorename.mount  \nmkdir -p \"$Where\"\necho \"$What $Where $Type $Options 0 2\" \u003e\u003e /etc/fstab  \nmount -a\n```  \n- Control if the drives are now correctly mounted  \n- Add a new Directory storage in pve/pbs using \"where\" as directory path  \n#### Zpool:  \n- run \n```shell\nzpool import\n```  \n- Take note of the \"pool\" name and run\n```shell\nzpool import -f $poolname\n```  \n- Add a new ZFS storage in pve/pbs  \n## SOURCES:\nhttps://pve.proxmox.com/wiki/Fail2ban  \nhttps://github.com/inettgmbh/fail2ban-proxmox-backup-server  \nhttps://forum.proxmox.com/threads/how-do-i-set-the-mail-server-to-be-used-in-proxmox.23669/  \nhttps://linuxscriptshub.com/configure-smtp-with-gmail-using-postfix/  \nhttps://suoption_pickedpport.google.com/accounts/answer/6010255  \nhttps://www.howtoforge.com/community/threads/solved-problem-with-outgoing-mail-from-server.53920/  \nhttp://mhawthorne.net/posts/2011-postfix-configuring-gmail-as-relay/  \nhttps://docs.oracle.com/en/cloud/cloud-at-customer/occ-get-started/add-ssh-enabled-user.html  \nhttps://www.noobunbox.net/serveur/monitoring/configurer-snmp-v3-sous-debian  \nhttps://github.com/DeadlockState/Proxmox-prepare  \nhttps://blog.lbdg.me/proxmox-best-performance-disable-swappiness/  \nhttps://gist.github.com/mrpeardotnet/6bdc4b504f43ce57fa7eaee96d376edf  \nhttps://github.com/DerDanilo/proxmox-stuff/blob/master/prox_config_backup.sh  \nhttps://pve.proxmox.com/wiki/Upgrade_from_6.x_to_7.0  \nhttps://wiki.debian.org/SSDOptimization  \nhttps://www.linuxtricks.fr/wiki/proxmox-quelques-infos  \nhttps://bobcares.com/blog/fail2ban-unban-ip/\n\n## TODO:  \nsettings for zram -\u003e https://pve.proxmox.com/wiki/Zram  \nPBS: add support for user creation and backup / restoration\nuser creation fro PBS when available  \nmake things stupid-proof (deny characters when numbers expected and so on)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTontonjo%2Fproxmox_toolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTontonjo%2Fproxmox_toolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTontonjo%2Fproxmox_toolbox/lists"}