Skip to content

Instantly share code, notes, and snippets.

@strelok1
Forked from maddox/commands.md
Last active December 20, 2015 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strelok1/6061440 to your computer and use it in GitHub Desktop.
Save strelok1/6061440 to your computer and use it in GitHub Desktop.

Install Samba 3 on OS X 10.7 Lion

Run the two commands below one at a time to get Samba 3 installed and to have it run on boot.

Install Samba with Homebrew

sh < <(curl https://raw.github.com/gist/6061440/df254d9a2ac83dddb04fcc7f9b634b65708aa477/)

Set Samba up to launch on boot

sudo sh < <(curl -s https://raw.github.com/gist/6061440/3eef666a05bffb215e34d54f0e25599a187cc7a6/install.sh)
#!/usr/bin/env bash
# disable system netbiosd-Daemon
sudo launchctl stop com.apple.netbiosd
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.netbiosd.plist
# create dirs that need to be there
mkdir /usr/local/Cellar/samba/3.6.3/var/locks
mkdir /usr/local/Cellar/samba/3.6.3/private
sudo smbpasswd -a `whoami`
# install new samba into launchd
sudo curl https://raw.github.com/gist/6061440/e9310a0cc981555a4d6cfed4c93a2d2ef1f04883/org.samba.smbd.plist >> /Library/LaunchAgents/org.samba.smbd.plist
sudo launchctl load -w /Library/LaunchAgents/org.samba.smbd.plist
# install new netbios into launchd
sudo curl https://raw.github.com/gist/6061440/b6c1c3d80c7a72895dbc8a5e4e03d63368c87c4f/org.samba.nmbd.plist >> /Library/LaunchAgents/org.samba.nmbd.plist
sudo launchctl load -w /Library/LaunchAgents/org.samba.nmbd.plist
#!/usr/bin/env bash
# https://github.com/mxcl/homebrew/pull/10311
# install samba
brew install https://raw.github.com/vertis/homebrew/e98536748ec8214bf0a527cf5515092140fc4b95/Library/Formula/samba.rb
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.samba.nmbd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/Cellar/samba/3.6.3/sbin/nmbd</string>
<string>-F</string>
</array>
<key>OnDemand</key>
<false/>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ServiceDescription</key>
<string>netbios</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.samba.smbd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/Cellar/samba/3.6.3/sbin/smbd</string>
<string>-F</string>
</array>
<key>OnDemand</key>
<false/>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ServiceDescription</key>
<string>samba</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment