First time user...would like to deploy never-booted image

pcamdm1
New Contributor II

As a first time user, I'm impressed with the array of knowledge here and hoping someone in here has tried this and been successful.

Is it possible deploy a never-booted image using Casper Imaging with an admin account added, SSH enabled for that account and a wireless profile? I've deployed a booted image with all of those items completed, but I'm a little new to scripting and wonder if someone has already done this, or if it's even possible.

Thanks!

5 REPLIES 5

Simmo
Contributor II
Contributor II

For creating the base OS install there is a handy tool called AutoDMG https://github.com/MagerValp/AutoDMG
To create accounts for adding in to the image I use https://github.com/MagerValp/CreateUserPkg

As for enabling SSH, I just have this as a run after imaging script, although there are many (and better) ways to enable this. (replace casper with your admin account.)

/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -specifiedUsers
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users "casper" -privs -all -restart -agent

The wireless profile I captured with Composer and added in to the image.

Picked up casper just a few months back and these tools have been helpful for me, but there are always other ways of doing it!

calumhunter
Valued Contributor

Enabling SSH could be done with AutoDMG, by creating a script and a launchagent then package them up and include it in your autodmg workflow, when the machine boots for the first time the launchagent runs the script which enables ard and then removes itself.

The wireless profile would done in a similar method, I'd create the profile using the Iphone configuration utility to generate a .mobileconfig file, then id use a script using the profiles command to install the profile. id then create a launchagent to run the script, package it up and dump it into autodmg workflow so that on first boot your machine will automatically configure itself

stevevalle
Contributor III

AutoDMG works well and does exactly what you want to do. I found this site helpful:
http://www.theinstructional.com/guides/build-deploy-os-x-images-with-autodmg

You can enable ssh with the following command:
launchctl load -w /System/Library/LaunchDaemons/ssh.plist

You can push out your wireless settings using a configuration profile.

pcamdm1
New Contributor II

I created the script in TextWrangler and the format is not recognized by the JSS.

stevevalle
Contributor III

@pcamdm1 - make the script executable:

sh-3.2# chmod +x /script.sh

You can run it in terminal to test it. If ssh is already enabled, you will get something like this:

sh-3.2# /script.sh
bind(): Address already in use
com.openssh.sshd: Already loaded
sh-3.2#