Enabling root user in Ubuntu

The root user in Ubuntu by default is assigned a random password and you are not given the option to change it during install time.

To change the password in order to logon as root, use the Users and Groups tool, locate the root user, then change the password.

Running scripts at predetermined times

You can use cron to schedule jobs to run at regular time intervals, but to run a script at a particular time and date, use the ‘at’ command.

at TIME [DATE] -f scriptname

where TIME is like 2:30pm or 10:00am, and date is in the format like ‘Mar 10’ or ‘Apr 01’.

To view scripts that are scheduled for execution, use the command: atq

This lists the scripts that are ‘queued’ for execution. The first digit on each line is the job number for each scheduled script. To remove/cancel a scheduled script, use the atrm command, with the job number.

Setting default routes

To set a default route via a router (192.168.0.1), use the following command:

<code>
route add default gw 192.168.0.1 netmask 0.0.0.0 eth0
</code>

– this will add a default route via the gateway at 192.168.0.1 for all traffic.