TurnKey Linux Virtual Appliance Library

Can't connect to a Samba Share

Drew Ruggles's picture

I have TKL Core with Samba Server installed. I've been through Webmin and Samba documentation, but can't get it to connect. I'm pretty sure my configuration is correct, but could be wrong, when I use the command line in Windows to connect, I get:

>net use x: \\192.168.0.19\temp
The password is invalid for \\192.168.0.19\temp.

To connect 192.168.0.19\Guest to 192.168.0.19, press ENTER, or type a new user n
ame: Drew
Enter the password for 192.168.0.19:
System error 58 has occurred.

The specified server cannot perform the requested operation.

I have a share labeled, "temp" and "Drew" is a valid Samba user. Here is my smb.conf Global settings:

#======================= Global Settings =======================

[global]
	log file = /var/log/samba/log.%m
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	obey pam restrictions = yes
	null passwords = yes
	map to guest = bad user
	encrypt passwords = yes
	passwd program = /usr/bin/passwd %u
	passdb backend = tdbsam
	wins support = true
	dns proxy = no
	netbios name = smb-antilles
	writeable = yes
	server string = %h server (Samba, Ubuntu)
	path = /tmp
	unix password sync = yes
	workgroup = BONESATHOME
	os level = 20
	valid users = Drew
	syslog = 0
	security = share
	panic action = /usr/share/samba/panic-action %d
	usershare allow guests = yes
	max log size = 1000
	pam password change = yes

Thoughts?

Drew

Drew Ruggles's picture

A little more info...

Jumped on the SO's Mac and tried to hook up to the Samba share. This time, if I entered the address wrong, it gave me a no-such-place type of error, whereas when I entered: smb://192.168.0.19/temp it gave me a bad user name or password response. In a way, that's a good thing, but in another, I'm at a bit of a loss as to how to correct, since I've already updated password on the change password module in webmin.

Drew

Drew Ruggles's picture

OK, 2 days is long enough

Are there any other alternatives to Samba Server for Windows / Ubuntu networking?

Thanks,

Drew

Jeremy's picture

Sorry for delay Drew...

I vaguely recall having some issues when initially getting it all going myself, but its the sort of thing that once it's sorted it works and I don't recall what I did (it's literally been years since I set up my TKL fileserver).

IIRC my issues came from Linux file permissions. Just like in Windows, you have share permissions and file permissions. The difference in Linux is that Samba takes care of the share permissions and the OS itself takes care of file permssions. That's why it won't work if you don't have the Linux users and Samba users synced. I don't use Webmin much, but Samba is one place I use it exclusively. So first up make sure that you have your Linux and Samba users synced (IIRC it's pretty self explanatory). I set up my Samba shares the same way I set up Windows ones - ie allow everyone read/write at the share level (for all shares you want access to) and control read/write permissions at the file level (ie Linux user file permissions).

In your set up it's probably even easier if you don't have local users that will mess with your stuff. Even if you do, it may be worth opening it all up to start with until you can get it working, then incrementally lock it down until it works how you want. Also somewhere buried here in the forums someone posted a working samba conf file after they had had similar issues. Not sure where that is though...

Hopefully that's the issue your having. For future reference (and just in case I haven't mentioned previously and/or you weren't aware) TKL v11.x is based on Ubuntu 10.04/Lucid so pretty much most stuff that applies to Lucid also applies to TKL. That makes all the Ubuntu Server guide and forum resources an invaluable source of additional support, documentation and general info.

Good luck.

And in answer to your most recent question, you could reconfigure vsftpd to connect to your server via FTP (vsftpd is already installed but is bound to localhost to provide the FTP backend for eXtplorer). AFAIK Win explorer can do FTP OOTB.

Drew Ruggles's picture

FTP Server is set up and running, however...

I really need a true shared networking resource. It was very fast and easy to set up the FTP, but that won't allow me to save files directly to my shared drive. It is interesting to see how many people have had problems configuring Samba. I did it once a couple years ago on a Drupal6 TKL, and I don't remember all the headaches I've had with this particular setup. Hmmm... gives me an idea -- maybe I should just look at my other smb.conf file and put it to good use...? Oh, yeah, it's on the back-up on a removable at an off-site location which is the reason I'm trying to set up a phpVirtualbox server, to no avail -- problems with the PHPvbox config, too, but that's another thread.

As always, thank you for your kind words and taking the time to reply.

Drew

Jeremy's picture

Have a look at this post by Chris

http://www.turnkeylinux.org/forum/support/20110317/tkl-fileserver-unable...

Hopefully that will some help? Also, like I said above, double check that Linux/Samba users are synced. And that the Linux user has at least read access to the folder.

Drew Ruggles's picture

Got it working, details to come...

I took your comments to heart and really focused on access and permissions:

Authentication (global access), File Share Defaults (global permissions)

Security and Access Control (share access), File Permissions (file permissions per share)

Basically, I have it working with just Guest permissions at the moment. There are probably more restrictions going on from a Linux user level, but I don't have a good feel for what that is, completely. The Systems Analyst in me will find out and report back, with screen shots of the Webmin interface settings for those of us who glaze over at command line instructions, but will endeavor to display the corresponding smb.conf settings, so as not to be a h8r.

But before the big summary of this issue, there's just one more thing, which I've started another thread about.

Jeremy's picture

Glad you've had some progress

I don't use Webmin much. When I first started with TKL I used Webmin a bit and there are still a few things I use it for (Samba being one of them) but TBH I find for most stuff commandline is more straightforward, quicker and easier.

When you think of the permissions, if you forget about the fact that Samba users and Linux users are different (because when the 2 user databases are synced the difference is irrelevant) then it's just like in Windows. Windows have share level permissions (which equate to Samba permissions) and user file permissions (which equate to Linux user file permissions). Personally I set up Samba shares the same as I do with Windows. Use the share level permissions to control read access, and the file permissions to control wire access.

I'm not sure thats the best way, but many years ago that's how I was taught to do it with a 2k3 server domain and I've just stuck with it.

As I said above I use Webmin to set up Samba permissions (full permissions to anyone who I'm happy to have any access at all). nd adjust read/write access as required using Linux users and groups (just like I would in Windows). Only difference is, rather than mucking around in a GUI, I can do it quick and easy at the commandline.

If you want me to try and explain how I'd do it a but better, try detailing your desired usage scenario and I'll tell you what I'd do.

Drew Ruggles's picture

I h8 Samba

Period

Jeremy's picture

What's the problem Drew?

I don't use it much, just set it and forget it. And it works as expected. I haven't reconfigured my home fileserver since I set it and it all works as expected. I'm happy to post the samba.conf of my fileserver if you think it would be any use to you. Although I'm still using the legacy (v2009.x) version which is based on Ubuntu 8.04 so it may be a little different...

Drew Ruggles's picture

got it working...

After far too many hours. What's frustrating (beyond the lack of clear examples) is all the different components, even within the config file and outside. Finally got it going after installing ftp and realizing debian installer created a group owner for my fat32 partition. I'll try to get a config file up though like before, it's wide open as far as permissions go. Drew

Jeremy's picture

Glad to hear you're getting there

But mate, geez you've been doing it tough! Hopefully once you get it all up and running it goes a little more smoothly for you!

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)