-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts for preparing global zone
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# curl -k https://gist.githubusercontent.com/sax/9138190/raw/prepare_global_zone | bash -s | ||
|
||
echo "*************************************************************" | ||
echo "Updating system to allow user modification" | ||
mkdir -p /opt/custom/smf | ||
mkdir -p /opt/custom/method | ||
|
||
curl --silent -k https://gist.githubusercontent.com/sax/9138190/raw/install-userfiles -o /opt/custom/method/install-userfiles | ||
curl --silent -k https://gist.githubusercontent.com/sax/9138190/raw/install-userfiles.xml -o /opt/custom/smf/install-userfiles.xml | ||
curl --silent -k https://gist.githubusercontent.com/sax/9138190/raw/persist-userfiles -o /opt/custom/method/persist-userfiles | ||
curl --silent -k https://gist.githubusercontent.com/sax/9138190/raw/persist-userfiles.xml -o /opt/custom/smf/persist-userfiles.xml | ||
|
||
chmod -R +x /opt/custom/method | ||
echo "*************************************************************" | ||
echo "In order to use tools such as usermod, please do the following:" | ||
echo " svcadm disable -s persist-userfiles" | ||
echo " useradd ..." | ||
echo " svcadm enable -s persist-userfiles" | ||
echo | ||
echo | ||
echo "*************************************************************" | ||
echo "Now reboot to ensure that everything is kosher." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
echo "*************************************************************" | ||
echo "Switching system into user modifiable state" | ||
|
||
svcadm disable -s persist-userfiles | ||
|
||
echo "*************************************************************" | ||
echo "Creating vagrant user" | ||
useradd -d /usbkey/vagrant -m -s /bin/bash vagrant | ||
usermod -P'Primary Administrator' vagrant | ||
|
||
echo "*************************************************************" | ||
echo "Setting password for Vagrant user. Please set it to 'vagrant'" | ||
passwd vagrant | ||
|
||
echo "*************************************************************" | ||
echo "Setting password for root user. Please set it to 'vagrant'" | ||
passwd root | ||
|
||
echo "*************************************************************" | ||
echo "Switching system back into non-user modifiable state" | ||
svcadm enable -s persist-userfiles | ||
|
||
echo "*************************************************************" | ||
echo "Configuring profile for vagrant user" | ||
|
||
echo 'if [ -e $HOME/.bashrc ]; then' > /usbkey/vagrant/.bash_profile | ||
echo ' . $HOME/.bashrc' >> /usbkey/vagrant/.bash_profile | ||
echo 'fi' >> /usbkey/vagrant/.bash_profile | ||
echo 'export PATH=/usr/bin:/usr/sbin/:smartdc/bin:/opt/local/bin:/opt/local/sbin:/usbkey/vagrant/bin' >> /usbkey/vagrant/.bash_profile | ||
|
||
chown vagrant:other /usbkey/vagrant/.bash_profile | ||
|
||
echo "*************************************************************" | ||
echo "Configuring ssh access for vagrant user" | ||
mkdir -p /usbkey/vagrant/.ssh | ||
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > /usbkey/vagrant/.ssh/authorized_keys | ||
echo 'export PATH=/usr/bin:/usr/sbin/:smartdc/bin:/opt/local/bin:/opt/local/sbin:/usbkey/vagrant/bin' > /usbkey/vagrant/.ssh/environment | ||
chown -R vagrant:other /usbkey/vagrant/.ssh | ||
chmod -R 0700 /usbkey/vagrant/.ssh | ||
|
||
mkdir -p /usbkey/vagrant/bin | ||
echo '#!/usr/bin/bash' > /usbkey/vagrant/bin/sudo | ||
echo 'pfexec $@' >> /usbkey/vagrant/bin/sudo | ||
chmod -R 0777 /usbkey/vagrant/bin |