📜 ⬆️ ⬇️

Installing samba3 on Mac OS X Lion 10.7.x

image After the release of the latest version of Mac OS X 10.7 Lion, access to shared directories via the samba protocol was lost. Rather, computers running Mac OS X see shared folders on windows resources, but there is no backward compatibility. This is due to the fact that samba, now has a GPLv3 license, which led Apple to develop its own module completely without backward compatibility.


First you need to install Xcode .

Then download and install the latest version of MacPorts , a system for installing software distributed in source codes.
')
After installing MacPorts, open the terminal.

Install the latest version of samba3:

sudo port install samba3 

After the automatic download and installation of all the packages necessary for the operation, we proceed to the configuration:

 sudo vi /opt/local/etc/samba3/smb.conf 

If you are not comfortable using the vi editor, you can install the Midnight Commander: sudo port install mc , and edit the file with it. Just do not forget to run it as root: sudo mc .

Here is an example configuration file, in this example, access is granted without a password:

 [global] workgroup = homenet ;    netbios name = MacBook ;    ;    john -    [john] comment = john path = /Users/john available = yes guest ok = yes create mask = 644 directory mask = 755 read only = no ;       [EXTERNAL] comment = EXTERNAL path = /Volumes/EXTERNAL available = yes guest ok = yes create mask = 644 directory mask = 755 read only = no 


We configure automatic start of the samba3 service. Create another 2 files: org.samba.smbd.plist and org.samba.nmbd.plist .

First file:

 sudo vi /Library/LaunchDaemons/org.samba.smbd.plist 

File contents:

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//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>OnDemand</key> <false/> <key>ProgramArguments</key> <array> <string>/opt/local/sbin/smbd</string> <string>-F</string> </array> <key>RunAtLoad</key> <true/> <key>ServiceDescription</key> <string>samba</string> </dict> </plist> 

Second file:

 sudo vi /Library/LaunchDaemons/org.samba.nmbd.plist 

File contents:

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//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>OnDemand</key> <false/> <key>ProgramArguments</key> <array> <string>/opt/local/sbin/nmbd</string> <string>-F</string> </array> <key>RunAtLoad</key> <true/> <key>ServiceDescription</key> <string>netbios</string> </dict> </plist> 

We stop and prohibit the launch of regular samba services:

 sudo launchctl stop com.apple.netbiosd sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.netbiosd.plist 

We activate our services:

 sudo launchctl load /Library/LaunchDaemons/org.samba.smbd.plist sudo launchctl load /Library/LaunchDaemons/org.samba.nmbd.plist 

All is ready.

Source: https://habr.com/ru/post/135192/


All Articles