MACOSX - Remote Software Update at the commandline

This is something I came across. It would some in handy if you want to update your macosx machine remotely.

Note: I claim no responsibility for your PC if you try this and have problems...

First you have to have SSH running on the computer. To do this open System Preferences, then click on sharing and check off Remote Logon. This enables the SSH server on port 22. In older versions of OSX you cannot control which accounts are allowed to use this service. So to configure this you would open a terminal and type the following...

sudo pico /private/etc/sshd_config
and add a line like this...
AllowUsers YourUsername


So after that from an ssh terminal as an adminstrative account...

sudo softwareupdate -l
(To list, updates)
sudo softwareupdate -i -a
(To install all)

There is more detailed information on this site...
http://www.ss64.com/osx/softwareupdate.html

If you want software to automatically run you can do the following...

From the terminal type: "sudo su" (To make yourself root)

then type:

pico /private/etc/crontab

This will most likely be blank. If it isn't then move to the bottom of any commands and enter this...

26 14 * * * /usr/bin/softwareupdate -i -a

Press CTRL+X to exit and press Y to save and leave the name as /private/etc/crontab.

This will add a scheduled cronjob to run software update automatically as root every day at 2:26 pm

There is more information about this here: http://uis.georgetown.edu/software/documentation/macosx1/macosx1.cron.html