Deploying GreenRADIUS on Ubuntu 20
Prerequisites
- An Ubuntu 20 server versioned 20.04 or greater
- Ensure the network interface is configured with a static IP, netmask, gateway, and DNS
- The update package for GreenRADIUS 5.1.6.6 or later
Steps
- Log in as a user with sudo access.
- Run
sudo apt-get update
- Run
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
- Run
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- Run
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- Run
sudo apt-get install docker-ce docker-ce-cli containerd.io
- Run
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
- Run
sudo chmod +x /usr/local/bin/docker-compose
- Run
sudo apt-get install unzip incron net-tools
- Run
sudo adduser gradmin
- Run
sudo adduser gradmin sudo
- Run
sudo chmod -R 750 /home/gradmin
- Run
sudo chown -R gradmin:gradmin /home/gradmin
- Reboot and log in as the
gradmin
user. - Run
sudo su
- Run
mkdir ~/temp
- Run
cd ~/temp
- Copy the GreenRADIUS update package to the
/home/gradmin/temp
directory of the Ubuntu instance. - For the following commands, replace
xxxx
with the version number of the GreenRADIUS updte package: - Run
sudo unzip GreenRADIUS_xxxx_Update.zip
- Run
sudo tar -xvzf GreenRADIUS_xxxx_Update/images.tgz -C .
- Run
sudo tar -xvzf GreenRADIUS_xxxx_Update/others.tgz -C .
- Run
sudo mkdir -p /opt/grs/scripts
- Run
sudo cp others/vm_incron_scripts/* /opt/grs/scripts/
- Run
cd /opt/grs/scripts && sudo chown root:root *.sh && sudo chmod 511 freeradius_restart.sh get_host_info.sh incron_script.sh openldap_cmd_template_3.sh openldap_restart.sh openldap_update_ca_certificates.sh rsyslog_restart.sh && cd -
- Run
sudo bash -c "echo 'gradmin ALL=(root) NOPASSWD:/opt/grs/scripts/get_host_info.sh , /opt/grs/scripts/incron_script.sh , /opt/grs/scripts/rsyslog_restart.sh , /opt/grs/scripts/freeradius_restart.sh , /opt/grs/scripts/openldap_restart.sh , /opt/grs/scripts/openldap_update_ca_certificates.sh , /opt/grs/scripts/openldap_cmd_template_3.sh' > /etc/sudoers.d/grs"
- Run
sudo mkdir -p /opt/grs/host-comm/request
- Run
sudo mkdir -p /opt/grs/host-comm/response
- Run
sudo chown -R gradmin:gradmin /opt/grs/host-comm
- Run
sudo bash -c "echo 'gradmin' > /etc/incron.allow"
- Run
sudo bash -c "echo '/opt/grs/host-comm/request IN_CLOSE_WRITE sudo /opt/grs/scripts/incron_script.sh \$#' > /var/spool/incron/gradmin"
- Run
sudo service incron restart
- Run
sudo docker load -i images/greenradius_xxxx_init_image
- Run
sudo docker load -i images/greenradius_xxxx_main_image
- Run
sudo docker load -i images/greenradius_xxxx_openldap_image
- Run
sudo docker load -i images/greenradius_xxxx_postgres_image
- Run
sudo docker load -i images/greenradius_xxxx_rsyslog_image
- Run
sudo docker load -i images/greenradius_xxxx_freeradius_image
- Run
sudo docker load -i images/greenradius_xxxx_grs_auth_app_image
- Run
sudo mkdir -p /home/gradmin/grs-docker-compose
- Run
sudo cp others/docker-compose.yml /home/gradmin/grs-docker-compose/
- Run
cd /home/gradmin/grs-docker-compose
- Run
sudo docker-compose up -d
- Once the previous step completes, the web administration console should be visible if you navigate to the server's IP address or hostname in your browser. Keep in mind that GreenRADIUS does not serve HTTP for security reasons; if you are getting Connection Refused errors, make sure the scheme is set to HTTPS.
- Run
sudo touch /etc/systemd/system/grs-docker-compose-app.service
- Edit the file and insert the following:
[Unit]
Description=Docker Compose Application Service
Requires=docker.service
After=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/gradmin/grs-docker-compose
ExecStart=/usr/local/bin/docker-compose up -d
ExecStop=/usr/local/bin/docker-compose down
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
- Run
sudo systemctl enable grs-docker-compose-app
- Run
sudo systemctl start grs-docker-compose-app.service
- Run
sudo rm -rf /home/gradmin/temp/*
The installation is now complete.
For installing subsequent GreenRADIUS updates:
In the following steps, replace xxxx
with the version number of the new update.
- Copy the GreenRADIUS update package to the
/home/gradmin/temp
directory. - Log in as
gradmin
. - Run
sudo apt-get update
- Run
sudo apt-get upgrade
- Run
cd ~/temp
- Run
sudo unzip GreenRADIUS_xxxx_Update.zip
- Run
sudo tar -xvzf GreenRADIUS_xxxx_Update/images.tgz -C .
- Run
sudo tar -xvzf GreenRADIUS_xxxx_Update/others.tgz -C .
- Run
sudo docker load -i images/greenradius_xxxx_init_image
- Run
sudo docker load -i images/greenradius_xxxx_main_image
- Run
sudo docker load -i images/greenradius_xxxx_openldap_image
- Run
sudo docker load -i images/greenradius_xxxx_postgres_image
- Run
sudo docker load -i images/greenradius_xxxx_rsyslog_image
- Run
sudo docker load -i images/greenradius_xxxx_freeradius_image
- Run
sudo docker load -i images/greenradius_xxxx_grs_auth_app_image
- Run
cd /home/gradmin/grs-docker-compose
- Run
sudo docker-compose down
- Run
sudo cp /home/gradmin/temp/others/docker-compose.yml .
- Run
sudo docker-compose up -d
To start or stop the containers:
Before starting or stopping the containers, make sure you are in the grs-docker-compose
directory with cd /home/gradmin/grs-docker-compose
.
Start the containers
sudo docker-compose up -d
Stop the containers
sudo docker-compose down
Updated 2024-03-29
© 2024 Green Rocket Security Inc. All rights reserved.
© 2024 Green Rocket Security Inc. All rights reserved.