Scheduling Reboots for the Access Gateway
Martijn Kools has very kindly let me repost his instructions for enabling SSH on the Access Gateway and scheduling a reboot. WARNING: This is a totally unsupported method for enabling SSH. Be sure to have a backup of the config of the AG and access to the Access Gateway CD to be able to perform a reinstall if required.
- Download a Linux Live CD such as Ubuntu or Knoppix. These instructions are based on Ubuntu.
- Boot the Access Gateway from the CD and choose the Safe VGA option.
- Once the machine has booted into the environment, open a Terminal window and enter a password for root:
sudo password root
- Now sudo to give yourself root access
su
- Create a directory in which to mount the Access Gateway filesystem:
mkdir /cag
- Mount the filesystem. If this is successful you should be able to list the contents of the appliances’ filesystem:
mount /dev/sda1 /cag
- To make changes to the system we need to change the root to /cag via:
chroot /cag
- Run
setup
and change the firewall settings from ‘high’ to ‘disabled’. - Go to system services, deselect ‘iptables’, make sure sshd and xinetd are selected, and press quit to save changes.
- Now run the SSH daemon to generate the key pairs:
/etc/init.d/sshd
- Exit the chroot environment and then unmount the CAG file system:
umount /cag
- Reboot the Access Gateway and use PuTTY to log into the appliance via SSH.
Now that SSH is enabled, we can schedule a reboot of the Access Gateway.
- SSH into the Access Gateway enable a cron job via crontab
crontab -e
- This will open the crontab file in vi. Insert a line by pressing ‘i’.
- Enable a reboot by entering the following:
0<tab>0<tab>*<tab>*<tab>*<tab>reboot
The first 0 displays the minute the command is being executed (0-59), the second 0 is the hour the command is executed (0-23), the first *
is the day of the month (1-31), the second *
is the month (1-12), the third * is the day of the week (0-6, sunday=0). So in this case the Access Gateway will reboot at 2am everyday.
- Press Esc to leave insert mode and then :wq and Enter to save the changes and quit.
Citrix have a hotfix available to enable SSH which should be supported. I will post more information once I can get a hold of this hotfix.