Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create Windows shares for non-home directories Network
One of the (very) nice features in Jaguar is the bundled Samba server, which allows your Mac to be visible to Windows computers. All you need to do is enable the setting for "Windows File Sharing" on the Services tab of the Sharing preferences panel (and make sure the user is allowed to connect from Windows boxes in the Accounts preferences panel). After that, each user can access his or her home folder from any Windows machine on the network.

While this is a great advance over the need to install and configure Samba, the downside is that only your home directory is shared. I needed to do more than this, as we keep our digitized CD collection on another hard drive and serve it up to a Turtle Beach Audiotron in the living room (see this hint for the details). So to get the Audiotron working, I needed a way to establish a Samba share for my iTunes hard drive.

After "phoning a friend," he pointed me to the smb.conf file located in /etc. I then spent a bit of time reading the extensive (over 100 pages!) man pages for smb.conf, and tried and failed a few (too many?) times before successfully creating my new share ... but in the end, I triumphed over the command line!

Read the rest of the article for a (very very light, for that's all I know!) introduction to creating additional Samba shares in Jaguar.

After reading a few pages of the manual, I got brave and decided to experiment. I started by creating a backup of the smb.conf file (sudo cp /etc/smb.conf /etc/smb.conf.bak). The basic structure of the smb.conf file isn't too hard to understand. The basic format is:
[name of share]
setting #1
setting #2
...

[name of next share]
etc
The trick is figuring out which settings to use, and what values to set them to. I am not promising that the following is the most correct, the most secure, or even good ... all I'm promising is that this worked for me and made my external hard drive visible to my Windows box (and the Audiotron, of course). I created a new share by editing (as root) the smb.conf file and adding these lines:
[music]
comment = iTunes files
path = /Volumes/myMusic/digitunes
browseable = yes
read only = no
create mode = 0750
I won't try to explain all the settings, but the important ones are the name of the share (the first line, in brackets), the path to the folder, and the "browseable = yes", which makes the share visible in the Network Neighborhood. I then used the GUI to disable and restart Windows file sharing, and then used this command to check the status of the shares:
 % smbutil view //localhost
After entering my admin password, the output is:
Share        Type       Comment
-------------------------------
music disk iTunes files
IPC$ pipe IPC Service (Samba 2.2.3a)
ADMIN$ disk IPC Service (Samba 2.2.3a)
robg disk User Home Directories
Notice that the "comment" line I created appears in the status report. Once I saw the share here, I switched over to my Windows box and was able to connect and browse without any problems.

Although this is a super-light introduction to editing the smb.conf file, perhaps its enough to save someone the 30 to 45 minutes I spent fighting the file tonight ;-).
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[39,291 views]  

Create Windows shares for non-home directories | 33 comments | Create New Account
Click here to return to the 'Create Windows shares for non-home directories' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Windows Shares & Foreign File Names
Authored by: legacyb4 on Aug 26, '02 03:33:27AM

Not a direct response, but perhaps someone can confirm if Samba supports double-byte characters?

From my Windows machine, all files that contain any Japanese have gone AWOL without even a sign of a question mark...



[ Reply to This | # ]
Windows Shares & Foreign File Names
Authored by: apparissus on Aug 26, '02 04:01:38AM

Samba does support double byte characters - I have several linux boxen and my trusty TiBook (running Jag) all happily sharing e-mails and docs containing Kana. Possibly the problem lies with Windows?



[ Reply to This | # ]
Windows Shares & Foreign File Names
Authored by: nichrome on Aug 26, '02 04:37:31AM

Indeed. Some (most) flavors of Windows fail to understand double-byte characters unless you install specialized language packs.



[ Reply to This | # ]
Windows Shares & Foreign File Names
Authored by: legacyb4 on Aug 26, '02 05:04:44AM

Will have to wait and see what other users say, but browsing from both Japanese NT & English/Japanese 2000 clients result in AWOL files.

Note that these clients have no issues seeing Japanese-named files or folders on the NT server...

Oh well, at least it's one step ahead of Windows in being a perfect network client!



[ Reply to This | # ]
Windows Shares & Foreign File Names
Authored by: legacyb4 on Aug 26, '02 05:08:38AM

Actually, if you are using Windows 2000, you don't need to install anything special other than going under Control Panel/Regional Options and enabling Japanese and the respective Code Page Conversion Table (Japanese) and Set Default to Japanese for the locale. Your menus will stay in English (unless you install the additional Language Pack) but you can install, run, and read Japanese (or any other language enabled) without breaking a sweat. Almost as sexy as the way OS X does it...



[ Reply to This | # ]
Editing smb.conf file
Authored by: leenoble_uk on Aug 26, '02 05:11:22AM

Can you still edit samba settings the old way?
By which I mean logging in as root and typing http://localhost:901 into a web browser.



[ Reply to This | # ]
Editing smb.conf file
Authored by: silicondiode on Aug 26, '02 08:11:03AM

SWAT doesn't seem to be included. any way to get it?



[ Reply to This | # ]
SWAT is there...
Authored by: robg on Aug 26, '02 09:45:17AM
I found swat in /usr/sbin, and then found documentation on this page of the Samba site regarding SWAT activation. Here's what it said about xinetd systems (which I believe is what Jaguar is using):
Xinetd Installation

Newer Linux systems ship with a more secure implementation of the inetd meta-daemon. The xinetd daemon can read configuration inf9ormation from a single file (i.e. /etc/xinetd.conf) or from a collection of service control files in the xinetd.d/ directory. These directions assume the latter configuration.

The following file should be created as /etc/xientd.d/swat. It is then be neccessary cause the meta-daemon to reload its configuration files. Refer to the xinetd man page for details on how to accomplish this.
## /etc/xinetd.d/swat
service swat
{
port = 901
socket_type = stream
wait = no
only_from = localhost
user = root
server = /usr/sbin/swat
log_on_failure += USERID
disable = No
}
I created the above file (as shown) to reflect the location of swat on OS X, and then restarted ... no luck. Logged in as root ... no luck.

So I'm stumped, but it looks like it should work ... anyone?

[ Reply to This | # ]
SWAT is there...
Authored by: silicondiode on Aug 26, '02 10:31:34AM

dumb question - does SWAT require that Web sharing be turned on?



[ Reply to This | # ]
Hmm, not sure...
Authored by: robg on Aug 26, '02 11:51:19AM

I think SWAT is its own little webserver, but I might be wrong...

-rob.



[ Reply to This | # ]
SWAT is there...
Authored by: vajonez on Aug 26, '02 02:09:23PM

10.2 is running inetd not xinetd. I followed the instructions in the swat man page for "INETD INSTALLATION" and it worked swimmingly.



[ Reply to This | # ]
SWAT is there...
Authored by: vajonez on Aug 26, '02 02:13:15PM

Oops. I, of course, used the actual location of the swat binary (/usr/sbin/swat instead of /usr/local/samba/bin/swat) when I modified /etc/inetd.conf.



[ Reply to This | # ]
SWAT is there...
Authored by: necrosis on Aug 30, '02 10:33:04PM

This does not work for me, set everything up buy the book (or rather man page) and when i do http://localhost:901 i get:

400 Server Error
chdir failed - the server is not configured correctly

...and i know it is.



[ Reply to This | # ]
SWAT is there...
Authored by: wesleykonrad on Sep 05, '02 06:57:23PM

I got the exact same error.



[ Reply to This | # ]
SWAT is there...
Authored by: vajonez on Feb 27, '03 02:39:29AM

Sorry guys, I just spun up a new machine and this just works. I wish i could help.



[ Reply to This | # ]
inetd vs. xinetd
Authored by: robg on Aug 26, '02 03:58:32PM

Cool! I'll write it up as a separate hint for those not following this thread. What's odd is that xinetd is definitely used for some things, such as the FTP server ... oh well, just shows my complete lack of knowledge on most things UNIX!

-rob.



[ Reply to This | # ]
inetd vs. xinetd
Authored by: rik_bogusz on Aug 26, '02 05:22:05PM

could you post further info on this on the main page? i've just tried editing the inetd.conf and the other file, and i don't think i've done it correctly yet, cant get the smb.conf browser editor up yet. i'm sure there's lots of us who really need to access other volumes/directories besides the home directory from a windows machine.

much TIA



[ Reply to This | # ]
SWAT is there...
Authored by: BraindeadMac on Sep 03, '02 06:28:00AM

Uh, actually xinetd is now the preferred internet services demon in 10.2 (this is detailed in the Apple documentation somewhere), but inetd is still supplied. If you updated 10.2 from 10.1.5, you'll see that the installer moved /etc/inetd.conf
to /etc/inetd.conf.applesaved and that the new inetd.conf has no services actually enabled.



[ Reply to This | # ]
Windows User Profiles?
Authored by: Beorn on Aug 26, '02 08:27:42PM
Does SMB require different user accounts? The way things are setup, it seems that when a Windows machine connects to the Jag Mac, it should authenticate using the User accounts that are setup in the "User Accounts" preference pane. However, when I try to authenticate, I get an error and the share fails to mount. Any ideas? Also, do the permissions that are setup in the Get Info window work for SMB networking, too, or does the SMB engine have its own setup?

[ Reply to This | # ]
SMB Manual?
Authored by: Beorn on Aug 27, '02 09:45:01AM
Where exactly may I find the SMB manual? I keep seeing references to the smb.conf (5) manual pages, but I don't know where to start looking. I'm fairly new to the terminal, so I'm sure that's part of the problem...

[ Reply to This | # ]
SMB Manual?
Authored by: rebug on Aug 28, '02 04:43:24PM
Type man smb.conf at your terminal prompt.

[ Reply to This | # ]
SMB Manual?
Authored by: Beorn on Aug 29, '02 01:42:43AM
I had tried that before I posted, and all I got was No manual entry for smb.conf. I don't have the Developer Tools installed, so could that be part of the problem? I also did an "update" rather than a clean install, and I've heard of others that have had issues with the man command on updated systems. That's probably the problem. I'm going to be backing up and wiping the drive clean in a couple days here anyway, so I'll see if that fixes things... Thanks though!

[ Reply to This | # ]
SMB Manual, more parameters
Authored by: JJ on Sep 17, '02 10:51:28AM

On a clean install (but without DevTools), I also get no manual page for smb.conf. I ssh'ed to a FreeBSD box for the manpages. All other man pages I've needed so far worked fine. Samba also works fine, I was able to add (and logon to) a new Share.

Maybe to give people some ideas for other useful parameters:

[utilities]
comment = Utilities on MacMind
path = /Volumes/MacMind/Utilities
available = yes
hosts allow = 192.168.0.
public = no
browseable = yes
writable = yes
hide files = /.*/Icon?/Desktop?D?/
printable = no

The above lets you easily:
- turn a share off (available = no)
- switch guest access on (public = yes)
- make the share readonly (writable = no)
- hide files which are meaningless on Windows
- only allow certain hosts

Thanks for a great tip!



[ Reply to This | # ]
smbutil...Authentication error
Authored by: andersANDsmith on Aug 28, '02 07:16:57PM

When I try to use the smbutil to check my shares I get the following error:

smbutil: unable to open connection: syserr = Authentication error
smbutil: could not login to server LOCALHOST: syserr = Authentication error

Any idea what the problem is?
Before I get the error I enter : 'smbutil view //localhost' and is asked for a 'Domain'.

I've tried different alternatives (just hitting enter or the actual domain name from the network I'm on) and then the 'password', but it keeps giving me the same error.

any help would be greatly appreciated
thansk



[ Reply to This | # ]
smbutil...Authentication error
Authored by: Boufon on Sep 02, '02 04:22:14AM

I've got exactly the same problem !



[ Reply to This | # ]
smbutil...Authentication error
Authored by: silento on Sep 06, '02 11:31:08AM

You have to check "Allow user to log in from Windows" in your user account. It's in System Prefs:Accounts at the bottom.

Also, I had to switch my network setting to pure DHCP, rather than manual configuration to get my Audiotron to see my music shares.



[ Reply to This | # ]
Unable to authenticate when connecting....
Authored by: aramirez on Sep 17, '02 02:05:50PM

I used a little app called sharepoints to set the file I wanted to share and it worked just fine. But when I try to connect to the shared file from my windows machine, in a domain not workgroup, I am not allowed to connect. Where I put my username comes back up with my username as such

DOMAIN/aramirez

but it should just be

aramirez

So then I tried changing the username to DOMAIN/aramirez... still did not work.

can anyone help?

cheers,

Andy R.



[ Reply to This | # ]
No samba users
Authored by: k3rmit on Sep 19, '02 04:28:26AM

The shares created in smb.conf can only be assigned to the system users defined in the preference pane....
This is quite annoying for me, since i have to create a share for the user www, which exists but has no password and no shell assigned. I corrected this out with the NetInfo Manager, but still id didn't work.

Theorically speaking samba and system users should not be the same, there are specifically defined key in the smb.conf file which permits not to link the system users with the samba users, but this is not what i wanted.

In fact with smbpasswd you create a password specifically for samba shares for users that already exist in the system.
The passdb for samba users doesn't exist by default in Jaguar, so with mkpassdb i created it and assigned to the user www the password...... guess what?? IT DIDN'T work either!!!

Quite annoying, it seems that smbd doesn't take the samba password file in consideration.

Is there someone who worked this out????

Thanks in advance

Alb3



[ Reply to This | # ]
No samba users
Authored by: qdzlug on Oct 16, '02 02:50:56PM

Well, this may help.....

All I wanted to do was to play music from my windows machine from a share on my powerbook.....searched, found this hint, and thought life was good.

So I tried to get sharing to work with my current configuration, but ran into the same problems above. 20 minutes and quite a bit of frustration later I figured out a workaround (good enough for now). I had a "postgres" user configured for some work I was doing with postgres a few weeks ago. I went in and checked "allow user to login from windows", and got back a dialog box to the effect of "in order to make this work we need to reset the password". Typed the password in on the windows side, clicked OK, and was working fine.

I still need to fix my login account, but for what I'm doing this works (for now).

HTH,

Jason



[ Reply to This | # ]
No samba users
Authored by: qdzlug on Oct 16, '02 02:53:39PM

OK, just got my account to work.

1) Make sure the "allow user to log in from windows" box is checked in Accounts.
2) Go into "My Account" and change your password.
3) Try to log in from Windows.

Worked for me, which is a good thing because I was finding it a bit frustrating trying to deal with it! ;>

Jason



[ Reply to This | # ]
Make your life easier...
Authored by: kerouassady on Oct 23, '02 11:21:26PM
...and install the Samba Sharing Package. It gives you a prefpane with a nice GUI. I've been using it for at least a year with no problems. It makes creating Windows shares as easy as SharePoints. Also, it gives you some good documentation for doing crazy things like authenticating Windows users and passwords with a Win2K/XP server.

[ Reply to This | # ]
Make your life easier...
Authored by: TomC on Sep 10, '03 12:56:51AM

Absolutely brilliant! Thanks for the tip. I was able to get Samba Sharing up and running in about 15 minutes. Now my Mac is happily sharing an external drive with my PC. Great program!



[ Reply to This | # ]
Create Windows shares for non-home directories
Authored by: abriening on Jul 22, '05 10:30:52AM

I'm about 3 years late on this response but...

You could create symlinks in your home folder to the folders or volumes on your mac. I symlinked my /Users/Shared and /Volumes/Backup (a separate drive on the mac) inside of ~/links/ folder. So now I let windows map my mac's home folder to G: and use G:\links\Shared or G:\links\Backup to get to these folders / volumes on the PC.

By the way the symlink looks like this ln -s /Volumes/Backup ~/links/Backup.



[ Reply to This | # ]